简体   繁体   中英

Using the new Application Registration results in an error message on login

I have a legacy B2C application that runs just fine. I decided to upgrade to the new 'experience' since the message said they're discontinuing the old legacy blade as of Nov-21. So I followed the instructions on this page: AAD B2C specifics When I start up the application, I get this message:

在此处输入图像描述

Switching back to the legacy application results in a working login screen.

• Since your Azure AD B2C application is a 'PublicClientApplication' , it has the property of 'UseCorporateNetwork' which is a Boolean that enables the application to benefit from Integrated Windows Authentication and SSO as these are cross platform capabilities. Thus, set this property to 'true' in 'package.appxmanifest' by enabling the capabilities, viz., Enterprise Authentication, Private Networks(Client & Server) and Shared User certificate .

Also, as IWA is not enabled by default as applications requesting the above type of authentication require a higher level of verification to be accepted for social identities using MSAL .NET.

Kindly check the 'RedirectURI' of your new Azure AD B2C experience as it may get overridden by that in 'UserDetailsClient\App.cs' . Hence, replace the 'RedirectURI' in your Azure AD B2C application by the one that is overridden in 'UserDetailsClient\App.cs' along with the msal://auth . Maybe, this should resolve your issue. For more details, kindly refer to the below Github link below: -

https://github.com/Azure-Samples/active-directory-b2c-xamarin-native/issues/28

To anyone running into a similar problem, I discovered two very interesting reasons for this problem: In the legacy, you could share applications between your web API and your client. In the new workflow, you need one 'application' for your Web API, and a distinct 'application' for your clients. This code seemed important to getting the new flow to work:

                this.PublicClientApplication = PublicClientApplicationBuilder
                    .Create(this.ClientId)
                    .WithIosKeychainSecurityGroup(this.KeychainGroup)
                    .WithRedirectUri(this.RedirectUri)
                    .WithB2CAuthority($"https://{this.AuthorityHostName}/tfp/{this.Tenant}/{this.AuthorityPolicy}")
                    .Build();

The 'WithRedirectUri' got me past the original error posted above.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM