Hello @Krishna Amal,
I understand that you are trying to log out from the application using the logout_hint
parameter without any prompt that is Prompt less logout.
The issue you are facing is because, you are passing logout_hint
as UPN.
Note: You need to pass login_hint
value in logout_hint
. Don't use UPNs or phone numbers as the value of the logout_hint
parameter. Refer this Microsoft Document: OpenID Connect (OIDC) on the Microsoft identity platform | Azure Docs
When I passed UPN as the logout_hint
in the request, I got the prompt:
Hence to resolve the issue, configure login_hint
as optional claim for ID token in the Microsoft Entra ID application:
Make sure to pass openid
and profile
scope in the request
I used the below endpoint to authorize/sign-in the user:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/authorize?
&client_id=ClientID
&response_type=code
&redirect_uri=https://jwt.ms
&response_mode=query
&scope=User.Read openid offline_access profile
&state=12345
Generated tokens using below parameters:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/token
client_id: ClientID
grant_type: authorization_code
scope: User.Read openid offline_access profile
redirect_uri: RedirectURL
code: xxx
client_secret: Secret
Decode the ID token, you will find login_hint
:
Make use of below request to logout from Microsoft Entra ID application without prompt:
https://login.microsoftonline.com/TenantID/oauth2/v2.0/logout?id_token_hint=IDTOKEN&post_logout_redirect_uri=REDIRECTURL&logout_hint=LoginHintValueFromIDToken
The user logged out successfully without any account selection prompt:
And you will be redirected to the redirect URL page without any prompt to select account to logout. Hope this helps!
If this answer was helpful, please click "Accept the answer" and mark Yes
, as this can be beneficial to other community members.
If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.