Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Include Login Hint in Authentication Properties #3452

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion source/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,7 @@ public static class Authentication
public const string SigninId = "signinid";
public const string SignoutId = "id";
public const string KatanaAuthenticationType = "katanaAuthenticationType";
public const string LoginHint = "login_hint";
public const string PartialLoginRememberMe = "idsvr:rememberme";
}

Expand Down Expand Up @@ -797,4 +798,4 @@ public static class ClaimValueTypes
OidcConstants.Algorithms.Asymmetric.PS512,
};
}
}
}
6 changes: 6 additions & 0 deletions source/Core/Endpoints/AuthenticationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ public async Task<IHttpActionResult> LoginExternal(string signin, string provide
// add the id to the dictionary so we can recall the cookie id on the callback
authProp.Dictionary.Add(Constants.Authentication.SigninId, signin);
authProp.Dictionary.Add(Constants.Authentication.KatanaAuthenticationType, provider);

if (signInMessage.LoginHint.IsPresent())
{
authProp.Dictionary.Add(Constants.Authentication.LoginHint, signInMessage.LoginHint);
}

context.Authentication.Challenge(authProp, provider);

return Unauthorized();
Expand Down