Skip to content

Commit

Permalink
Fix for #415 (#428)
Browse files Browse the repository at this point in the history
domain_hint ingored when login_hint is set.
Break up code so that domain_hint and login_hint are treated
independently.

Co-authored-by: Thibault Durand <thibault.durand@liu.se>
  • Loading branch information
durandt and ThibaultDurand2023 authored Aug 10, 2020
1 parent 876cb86 commit 18fe4ce
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,19 @@ public static AuthenticationBuilder AddMicrosoftWebApp(
if (!string.IsNullOrWhiteSpace(login))
{
context.ProtocolMessage.LoginHint = login;
context.ProtocolMessage.DomainHint = context.Properties.GetParameter<string>(
OpenIdConnectParameterNames.DomainHint);
// delete the login_hint and domainHint from the Properties when we are done otherwise
// delete the login_hint from the Properties when we are done otherwise
// it will take up extra space in the cookie.
context.Properties.Parameters.Remove(OpenIdConnectParameterNames.LoginHint);
}
var domainHint = context.Properties.GetParameter<string>(OpenIdConnectParameterNames.DomainHint);
if (!string.IsNullOrWhiteSpace(domainHint))
{
context.ProtocolMessage.DomainHint = domainHint;
// delete the domain_hint from the Properties when we are done otherwise
// it will take up extra space in the cookie.
context.Properties.Parameters.Remove(OpenIdConnectParameterNames.DomainHint);
}
Expand Down

0 comments on commit 18fe4ce

Please sign in to comment.