Xamarin MSAL Azure AD ADFS AcquireTokenInteractive error

hernandoZ 46 Reputation points
2023-09-18T17:06:38.9333333+00:00

Hi I just seen this error in our app ,

ERROR

Web page not Available

The web page at https://adfs.srm.com/adfs/ls/wia?client-request-id=##########

Could not be loaded because : net::ERR_HTTP_RESPONSE_CODE_FAILURE

Screenshot 2023-09-18 174103

Normally the user enter their email account, then it gets taken to another "Taking you to your organisation's sign-in page" then screen to enter the password .

Screenshot 2023-09-19 071400

Since 2 weeks ago they get the error (1st image), after the "Taking you to your organisation's sign-in page" is loading . As far as I know this was working 2 or 3 weeks ago.

I cannot find any information regarding this error , any ideas ?

Authentication method



var builder = PublicClientApplicationBuilder.Create(AppConstants.AadClientId)
.WithIosKeychainSecurityGroup(AppConstants.AppId)
.WithRedirectUri(RedirectUri)
.WithLogging(Log, LogLevel.Verbose, enablePiiLogging: true, enableDefaultPlatformLogging: false)
.WithAuthority(AzureCloudInstance.AzurePublic , AppConstants.TenantId);
try
{
    var accounts = await _pca.GetAccountsAsync();
    var firstAccount = accounts.FirstOrDefault();
    var authResult = await _pca.AcquireTokenSilent(Scopes, firstAccount).ExecuteAsync();
	
	// Store the access token securely for later use.

}
catch (MsalUiRequiredException)
{
    try
    {
        // This means we need to login again through the MSAL window.

		//this is where it hangs and I don't see any error or response
        var authResult = await _pca.AcquireTokenInteractive(Scopes)
                                    .WithUseEmbeddedWebView(true)
                                    .ExecuteAsync();

        // Store the access token securely for later use.
        
    }

ADFS server is working fine for other browsers applications.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,305 questions
Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
5,707 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,947 questions
{count} votes

Accepted answer
  1. 2023-10-14T02:00:26.6866667+00:00

    Hello @hernandoZ and thanks for sharing your solution. Since accepting and rating your own answer is not possible I'm reposting it here so you can accept and rate it so that others facing a similar issue can easily find a solution.

    Problem solve it was an ADFS Serve configuration.

    0 comments No comments

0 additional answers

Sort by: Most helpful