active-directory-b2c-xamarin-native | simple Xamarin Forms app showcasing how to use MSAL | Azure library
kandi X-RAY | active-directory-b2c-xamarin-native Summary
kandi X-RAY | active-directory-b2c-xamarin-native Summary
page_type: sample description: "This is a simple Xamarin Forms app showcasing how to use MSAL to authenticate users via Azure Active Directory B2C." languages:.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of active-directory-b2c-xamarin-native
active-directory-b2c-xamarin-native Key Features
active-directory-b2c-xamarin-native Examples and Code Snippets
Community Discussions
Trending Discussions on active-directory-b2c-xamarin-native
QUESTION
I followed this sample https://github.com/Azure-Samples/active-directory-b2c-xamarin-native to implement Azure B2C auth in Xamarin Forms.
There are two GUID in the sample
...ANSWER
Answered 2021-Feb-05 at 06:31It's a Custom Redirect URI.You should make sure that your application has enabled the Native client setting and create it as shown in the following screenshot:
You could look at this.
QUESTION
We have integrated a sample Xamarin app with AAD B2C by following the guidelines provided in https://github.com/Azure-Samples/active-directory-b2c-xamarin-native
We are not invoking the CallAPI method now. As a response after authentication, we are just receiving the id_token and not access_token.
Do I have to mandatorily invoke the API for getting the access token generated? We are not using client_secret.
Does the response post authentication not include the id_token and access_token, both?
...ANSWER
Answered 2020-Aug-28 at 10:04This is the call that is used to sign the user in interactively (source):
QUESTION
I followed the example from this repo https://github.com/Azure-Samples/active-directory-b2c-xamarin-native and got the authentication working. A user can register and authenticate perfectly.
the problem is, after a user is authenticated when this code runs, it can never aquire a silent token.
...ANSWER
Answered 2020-Jun-29 at 22:00Unfortunately, I have found many times that MSAL is poorly documented. For this reason, many samples and apps that rely on it are not able to provide strong documentation either.
There is a github issue with a similar experience in another xamarin repository that uses the same identity client package:
https://github.com/Azure-Samples/active-directory-xamarin-native-v2/issues/38
Include="Microsoft.Identity.Client" version="4.13.0"
This issue links to the following articles:
Which indicates:
Known issue with Azure AD B2C MSAL.NET supports a token cache. The token caching key is based on the claims returned by the identity provider (IdP). Currently, MSAL.NET needs two claims to build a token cache key:
- tid (the Azure AD tenant ID)
- preferred_username
Both of these claims may be missing in Azure AD B2C scenarios because not all social identity providers (Facebook, Google, and others) return them in the tokens they return to Azure AD B2C.A symptom of such a scenario is that MSAL.NET returns Missing from the token response when you access the preferred_username claim value in tokens issued by Azure AD B2C. MSAL uses the Missing from the token response value for preferred_username to maintain cache cross-compatibility between libraries.
Some workarounds are provided in the Microsoft article, and the GitHub article suggests implementation changes:
Workarounds Mitigation for missing tenant ID The suggested workaround is to use caching by policy described earlier.
Alternatively, you can use the tid claim if you're using custom policies in Azure AD B2C. Custom policies can return additional claims to your application by using claims transformation.
Mitigation for "Missing from the token response" One option is to use the name claim instead of preferred_username. To include the name claim in ID tokens issued by Azure AD B2C, select Display Name when you configure your user flow.
For more information about specifying which claims are returned by your user flows, see Tutorial: Create user flows in Azure AD B2C.
Hopefully, some of these discoveries can put you on the right path.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install active-directory-b2c-xamarin-native
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page