I have an identity server configured which our Asp.Net Core website uses for authentication. When we issue a challenge in the website, it obviously gets picked up in the Challenge controller action in External Controller in ID server. If I add authentication properties to the website challenge, I can't see how to retrieve them in challenge controller action in ID server. Does anyone know how I can do this? I need to pass information from the website challenge to ID server.
Asked
Active
Viewed 418 times
2
-
I'm looking for something very similar. Cannot seem to find anything :( – Kappacake Oct 07 '22 at 09:32
1 Answers
0
If anyone else has wondered how to do this, I managed to fix it by doing the following in the client within .AddOpenIdConnect.
options.Events.OnRedirectToIdentityProvider = async context =>
{
context.ProtocolMessage.AcrValues = "YourKey:YourValue";
await Task.FromResult(0);
};
Then in the identity servers Challenge controller action in ExternalController, you can retrieve the values like this.
var authorizationContext = await _interaction.GetAuthorizationContextAsync(returnUrl);
if (authorizationContext.AcrValues.Contains("YourKey"))
{
props.Items.Add(authorizationContext.AcrValues["YourKey"]);
}

doogdeb
- 400
- 3
- 8