Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] silenttoken not getting on iOS #5141

Closed
RaiAlka opened this issue Feb 13, 2025 · 2 comments
Closed

[Bug] silenttoken not getting on iOS #5141

RaiAlka opened this issue Feb 13, 2025 · 2 comments
Labels
needs attention Delete label after triage Possible-Solution public-client Similar-Issue untriaged Do not delete. Needed for Automation

Comments

@RaiAlka
Copy link

RaiAlka commented Feb 13, 2025

Library version used

Msal 1.2.9

.NET version

Application is built in native iOS using Msal sdk

Scenario

PublicClient - mobile app

Is this a new or an existing app?

The app is in production, I haven't upgraded MSAL, but started seeing this issue

Issue description and reproduction steps

Recently using new policies and facing below issue
[+oneAppLog][AzureUtility.getTokenSilently(policy:completionHandler:)] - Azure Utility acquireToken SILENTLY error : Optional(Error Domain=MSALErrorDomain Code=-50002 "(null)" UserInfo={MSALErrorDescriptionKey=User interaction is required, MSALOAuthErrorKey=invalid_grant, MSALCorrelationIDKey=9CB85855-62A1-4EFE-99FE-4EE364304B15, NSUnderlyingError=0x3007620d0 {Error Domain=MSALErrorDomain Code=-50000 "(null)" UserInfo={MSALErrorDescriptionKey=AADB2C90129: The provided grant has been revoked. Please reauthenticate and try again.
 
Correlation ID: a8589387-c7bc-429d-9322-1fe0f390de77

But if same users signing in getting silent token

Relevant code snippets

Expected behavior

For new users also silenttoken should be generated

Identity provider

Azure B2C Custom Policy

Regression

No response

Solution and workarounds

No response

@RaiAlka RaiAlka added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Feb 13, 2025
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Solution 1:

Use Microsoft.Identity.Client only, as it worked for me when I faced a similar issue with B2C.

Reference:

Solution 2:

MSAL's embedded browser is based on an old version of Internet Explorer. Broker doesn't work with B2C. You can use WebView2 - see https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/main/src/client/Microsoft.Identity.Client.Desktop/DesktopExtensions.cs#L61 (you'll need to install the MSAL.Desktop package).

Reference:

@bgavrilMS
Copy link
Member

This is the SDK for .NET repo, I believe you want to open issue on the iOS repo: https://github.com/AzureAD/microsoft-authentication-library-for-objc

@bgavrilMS bgavrilMS closed this as not planned Won't fix, can't repro, duplicate, stale Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs attention Delete label after triage Possible-Solution public-client Similar-Issue untriaged Do not delete. Needed for Automation
Projects
None yet
Development

No branches or pull requests

2 participants