How can I use IdentityServer.accesstokenvalidation package to validate tokens using multiple authorities?
In my front end application I am getting a token using let us say on of the following:
1- subdomain1.identityserver.com
2- subdomain2.identityserver.com
3- subdomain3.identityserver.com
Now if I get a token using subdomain1.identityserver.com then the token will look like:
{
"nbf": ,
"exp": ,
"iss": "subdomain1.identityserver.com",
"aud": [
"subdomain1.identityserver.com/resources",
],
"client_id": "Frontend",
"sub": "",
"auth_time": 1516002171,
"idp": "local",
"scope": [
"openid",
"profile",
],
"amr": [
"external"
]
}
In my APIs I am using IdentityServer.accesstokenvalidation to validate these tokens, how can I tell my APIs to use the issuer (iss in token) as authority?
I tried something like:
JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary<string, string>();
app.UseIdentityServerBearerTokenAuthentication(new IdentityServerBearerTokenAuthenticationOptions
{
Authority = variable,
DelayLoadMetadata = true,
});
Where Authority is a variable, but it looks like the authority would be registered once at startup.