Skip to content

Redirect back to Android App Not working fully #143

@bradyguyc

Description

@bradyguyc

I built this example with .NET 10 preview and on android after authentication which is valid it pops up a dialog to select from apps.

https://github.com/Azure-Samples/ms-identity-ciam-dotnet-tutorial/tree/main/1-Authentication/2-sign-in-maui

The only changes I made to the sample are the client id. The updatemsal.ps1 is a script that updates the msal from appsetttings.json.

Image

Image

Using an older method for MSAL I don't see this problem. After I click sign in on this image it goes straight back to the app. This older method is using policy based method I believe.

         AuthenticationResult result = await PCAWrapperB2C.Instance.AcquireTokenInteractiveAsync(B2CConstants.Scopes);

private PCAWrapperB2C()
{
// Create PCA once. Make sure that all the config parameters below are passed
PCA = PublicClientApplicationBuilder
.Create(B2CConstants.ClientID)
.WithExperimentalFeatures() // this is for upcoming logger
.WithLogging(_logger)

                              .WithB2CAuthority(B2CConstants.AuthoritySignInSignUp)
                              .WithIosKeychainSecurityGroup(B2CConstants.IOSKeyChainGroup)
                              .WithRedirectUri(B2CConstants.RedirectUri)
                              .Build();

}

public static string Tenant = "MyNextbook.onmicrosoft.com";
public static string AzureADB2CHostname = "MyNextbook.b2clogin.com";

public static string ClientID = "b3f22bxxx...";

public static readonly string RedirectUri = $"msal{ClientID}://auth";

public static string PolicySignUpSignIn = "B2C_1_MNB_SignInSignUp";

public static string[] Scopes = {
"https://MyNextBook.onmicrosoft.com/api/user_impersonation"
};

public static readonly string AuthorityBase = $"https://{AzureADB2CHostname}/tfp/{Tenant}/";
public static readonly string AuthoritySignInSignUp = $"{AuthorityBase}{PolicySignUpSignIn}";
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions