I have read several articles on adding Azure Active Directory sign-in functionality to Xamarin PCL projects (e.g. https://blog.xamarin.com/put-adal-xamarin-forms/) but I am still not able to make it work.
Can someone please clarifiy the correct ADAL package to use for Azure B2C AD(for Xamarin PCL project)?
Is it:
Microsoft.IdentityModel.Clients.ActiveDirectory
OR
Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory
Thanks!
Thanks to #Kaush and #vibronet for pointing me in the right direction, saving a lot of time.
For anyone wanting to add B2C Sign-In & Sign-Up flows to a Xamarin Forms project - I was able to mash-up a solution for Android as follows:
At all times change any reference to Microsoft.IdentityModel.Clients.ActiveDirectory to Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory
Add the Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory package to all projects. If a compatibility error occurs in the PCL project then manually add a package reference using 'Add Reference' as described by #Kaush. I chose the 'portable-net45+win+wpa81' library.
Implement the flows as described here: https://blog.xamarin.com/put-adal-xamarin-forms/
Change the call to 'AcquireTokenAsync' to:
var result = await authContext.AcquireTokenAsync(new string[] { clientId }, null, clientId, new Uri(returnUri), platformParams, "{Policy_Name_Here}");
Notes:
Ensure the format of the authority is 'https://login.microsoftonline.com/{Tenant_Name_Here}.onmicrosoft.com'
This is experimental based on alpha code so expect it to change / break / evolve in the near future.
Microsoft.Experimental.IdentityModel.Clients.ActiveDirectory is the right package for B2C, but the Xamarin scenario wasn't one targeted by this preview. We'll be adding new platforms as we refresh the preview going forward.
I would pay heed to what #vibronet says, but having said that (and to get you going), here's my screen shot of all the references that I use in the sample project you mentioned:
The ADAL package version I used was: 3.5.207081303-alpha (Prerelease), nuget did not add it to my PCL library, I ended up adding the reference explicitly via the 'Add Reference' and browsing to the package, maybe you could try the same.
Lastly, I had to add the extraQueryParameters as specified in here
Let me know how you go...
Related
Is there anyway to select a tenant that is not default when I log in via Azure Toolkit for IntelliJ ?
Once I sign in, there seems to be no way to change the tenant. How do I do that ?
It says this has been fixed in a GitHub issue, but provides no details on how to use the functionality.
It is marked as feature request but not yet implemented this way of Signing of selecting a tenant in IntelliJ IDE Toolkit as described in this GitHub Issue #4456 you have mentioned.
From this Issue, I have traversed the previous ticket issues given at the end of each Ticket Page and then I came to know this is marked as feature-request type but not fixed yet and they have provided the MS doc everywhere which provides the information on available ways of Sign-in instructions in IntelliJ IDE ToolKit.
Im looking into configuring authentication for Azure B2C OIDC authentication on Ckan and was wondering if its possible to do so without modification to the code base or has anyone done it before..
I heard that it might be possible to install extensions for more features on Ckan but I am unsure which extension is for OpenID. I can't really find much documentation regarding this as well.
Any advice?
Yes, it is possible to install extensions to add more features on CKAN.
https://github.com/bcgov/ckanext-sso looks like the most updated extension although the README says it's for CKAN 2.7 and it may need some work to be compatible with newer versions of CKAN.
https://github.com/keitaroinc/ckanext-saml2auth/ is a well maintained extension for SAML2 that can provide some guidance if you need to implement your own extension.
Documentation on how to build custom extensions for CKAN can be found at: https://docs.ckan.org/en/latest/extensions/index.html
Bests!
I created and uploaded a plugin but when I tried to add it to my app I could not find it. I have tried searching for my plugin in the "My Features" and "Marketplace" section but could not find it anywhere. The tutorial video was also outdated so it did not help me at all. Is there something I am doing wrong?
I would need more information to give you an exact answer. However, I believe you haven't issued a license key to your App.
Context:
When you create a developer account you are issued a developer app to test on. This app automatically receives all new plugins uploaded. Many developers end up creating multiple apps, which is fine. However, licenses will not be automatically issued to every app you have access to. You can see how that would be problematic. You would have to do so manually (Once per app).
Purposed Solution
Issue a new license for your app. You can use an existing license key if there are seats left. To find more information on how to do so click here:
https://github.com/BuildFire/sdk/wiki/How-to-issue-a-private-license
After creating the license key, just install it in your apps marketplace.
If you dont see this "Install new plugin" button in your marketplace that means your app is on a lower tier. Contact customer support to review your options to upgrade.
I hope this helps.
For almost a week now I have been trying to implement Authentication in a Xamarin.Forms(Android, iOS and Windows) Project to no avail. All the instructions and guides are either out of date, not clear or not functioning.
This Article from Xamarin was last updated in August 2016 while the MSAL has changed making this article obsolete. in this article they make use of PlatformParameters which has been replaced by UIParent.
This Example from Azure AD B2C documentation page from after implementing has UIRequiredException as calling AcquireTokenSilentAsync is not functioning since as at that time there is no user present.
This is getting really frustrating and would appreciate assistance or some step by step to implement this. All am trying to do is enable Authentication and Authorization for my Xamarin.Forms App and API Endpoint. Any pointer to good working code would be appreciated.
It would be helpful if there is an official updated guide or Video tutorial to help with this.
had exactly the same issue with using this project for a demo.
Use this version:
https://azure.microsoft.com/en-us/resources/samples/active-directory-b2c-xamarin-native/
It is the updated version with MSAL 2.4 preview. Its working on all samples/droid/ios/uwp
Here is a much fresher sample on how to get this done (as of June 20,2017 )
https://github.com/Azure-Samples/active-directory-b2c-xamarin-native
We have had issues with the same example. https://github.com/Azure-Samples/active-directory-b2c-xamarin-native
I have pretty much given up and I am looking at other solutions now.
I'm trying to use the following guide to authenticate my (java) app to an internally hosted Sharepoint 2013 site: https://msdn.microsoft.com/en-us/library/jj687470.aspx
I've already registered the app and have the client ID and secret. Unfortunately, this method relies heavily on TokenHelper.cs (or .vb), but I'm unable to find a java equivalent that either Microsoft or a 3rd party developer has written.
Any help pointing me in the right direction would be appreciated!
Use the Active Directory Authentication Library. Instructions and libraries are available here.
Personally I have used the Android library, and I can say that it works like a charm.