How to use azure B2C with Essentials: Web Authenticator?

Phenek 116 Reputation points
2021-09-09T12:45:29.007+00:00

Hello,
I am trying to consume B2C user flow authentification with Web Authenticator
(from essentials package Xamarin.forms or MAUI). Web-authenticator

I am unable to add correctly some parameters required for B2C
like 'client_id', 'scope', etc... inside the url, I got always 'bad url' message.

var url = new Uri("https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/authorize?client_id{ClientId}&response_type=code&scope={Scope}");  
var callbackUrl = new Uri("myapp://auth");  
var authResult = await WebAuthenticator.AuthenticateAsync(new WebAuthenticatorOptions  
   {  
      Url = url,  
      CallbackUrl = callbackUrl,  
      PrefersEphemeralWebBrowserSession = false,  
   });  
  

Did someone achieved this kind of stuff?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,293 questions
Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,639 questions
{count} vote