question

VicePhenek-7065 avatar image
1 Vote"
VicePhenek-7065 asked VicePhenek-7065 edited

How to consume direct link to identity provider with azure B2C?

Hello,

I would like to consume third party identity provider in my application.
B2C provide a MSAL WebView authentication with pre-generated or custom page layout (with username, password, and button for social providers).
like below
130707-screenshot-2021-09-09-at-145924.png


But I would like to create my own native button, that will open directly the web view on a specific identity provider.
Does Microsoft provide such flow without using the pre-generated or custom page layout, but redirect instantly to the Identity provider?

If Microsoft does not, where can suggest new feature, enhancement and vote for them?

Let me know,
Regards :)

dotnet-xamarinazure-ad-b2c
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

VicePhenek-7065 avatar image
1 Vote"
VicePhenek-7065 answered VicePhenek-7065 edited

The goal is to use the domain_hint parameter
For example if the application specifies domain_hint=facebook.com, sign-in goes directly to the Facebook sign-in page.

Url Parameter:

 "https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/authorize?client_id{ClientId}&response_type=code&scope={Scope}&domain_hint=facebook.com"

Code:

 let loginRequest = {
      extraQueryParameters: {domain_hint: 'facebook.com'}
 }
 myMSALObj.loginPopup(loginRequest);

Here two Microsoft doc links that explain how to do it.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KyleWang-MSFT avatar image
1 Vote"
KyleWang-MSFT answered KyleWang-MSFT edited

Hi VicePhenek-7065,

Welcome to our Microsoft Q&A platform!

To achieve authentication, Xamarin.Forms provides the Xamarin.Essentials: Web Authenticator.

There are also some Nuget packages, such as Microsoft.Identity.Client and Xamarin.Auth, you can refer to.

If you have any feature request, you can submit on GitHub: xamarin/Xamarin.Forms.

Regards,
Kyle


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

VicePhenek-7065 avatar image
1 Vote"
VicePhenek-7065 answered VicePhenek-7065 edited

Hi @KyleWang-MSFT,

Thanks I am glad to have a Community expert to this topic.
I have already a question about Web Authenticator.
And I don't think this feature about B2C should be submitted to Xamarin.forms GitHub (even if they have ended all enhancement to the profit of maui)

We would prefer any B2C GitHub,
because my question was all about B2C and it's available User Flow and specifically how to preselect an identity provider?


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.