Skip to content

Commit 6b1e9be

Browse files
author
Tiago Brenck
committed
Removing login_hint from signout since it is not supported on OIDC v2 anymore.
1 parent cfb2a39 commit 6b1e9be

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

1-WebApp-OIDC/1-6-SignOut/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ from <https://github.com/aspnet/AspNetCore/blob/master/src/Azure/AzureAD/Authent
5353

5454
### Intercepting the call to the logout endpoint
5555

56-
The ASP.NET Core OpenIdConnect middleware enables your app to intercept the call to the Microsoft identity platform logout endpoint by providing an OpenIdConnect event named `OnRedirectToIdentityProviderForSignOut`. The web app uses it to attempt to avoid the select account dialog to be presented to the user when signing out. This interception is done in the `AddAzureAdV2Authentication` of the `Microsoft.Identity.Web` reusable library. See [StartupHelpers.cs L58-L66](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/blob/b87a1d859ff9f9a4a98eb7b701e6a1128d802ec5/Microsoft.Identity.Web/StartupHelpers.cs#L58-L66)
56+
The ASP.NET Core OpenIdConnect middleware enables your app to intercept the call to the Microsoft identity platform logout endpoint by providing an OpenIdConnect event named `OnRedirectToIdentityProviderForSignOut`.
5757

5858
```CSharp
5959
public static IServiceCollection AddAzureAdV2Authentication(this IServiceCollection services,
@@ -65,13 +65,10 @@ public static IServiceCollection AddAzureAdV2Authentication(this IServiceCollect
6565
...
6666
options.Authority = options.Authority + "/v2.0/";
6767
...
68-
// Attempt to avoid displaying the select account dialog when signing out
68+
6969
options.Events.OnRedirectToIdentityProviderForSignOut = async context =>
7070
{
71-
var user = context.HttpContext.User;
72-
context.ProtocolMessage.LoginHint = user.GetLoginHint();
73-
context.ProtocolMessage.DomainHint = user.GetDomainHint();
74-
await Task.FromResult(0);
71+
//Your logic here
7572
};
7673
}
7774
}

Microsoft.Identity.Web/StartupHelpers.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,6 @@ public static IServiceCollection AddAzureAdV2Authentication(this IServiceCollect
7878
// Force the account selection (to avoid automatic sign-in with the account signed-in with Windows)
7979
//options.Prompt = "select_account";
8080

81-
// Handling the sign-out
82-
options.Events.OnRedirectToIdentityProviderForSignOut = async context =>
83-
{
84-
var user = context.HttpContext.User;
85-
86-
// Avoid displaying the select account dialog
87-
context.ProtocolMessage.LoginHint = user.GetLoginHint();
88-
context.ProtocolMessage.DomainHint = user.GetDomainHint();
89-
await Task.FromResult(0);
90-
};
91-
9281
// Avoids having users being presented the select account dialog when they are already signed-in
9382
// for instance when going through incremental consent
9483
options.Events.OnRedirectToIdentityProvider = context =>

0 commit comments

Comments
 (0)