Duplicate scopes in JWT claims
I have created an ApiResource with a several Scopes:
new ApiResource
{
Name = "TestName",
DisplayName = "Allow application to access your account",
ApiSecrets = new List<Secret>{new Secret("scopeSecret".Sha256())},
Scopes = new List<Scope>
{
new Scope(Constants.Scope, "Allow application to access your account"){Required = true },
new Scope("ScopeA", "Allow application to make A"),
new Scope("ScopeB", "Allow application to make B")
}
}
Now when a JWT is generated for a client that is allowed to request those two scopes, they are included twice in token claims
{
"nbf": 1496218768,
"exp": 1496222368,
"iss": "MyIdentityServer",
"aud": [
"MyIdentityServer/resources",
"customAPI",
"TestName"
],
"client_id": "TestWebApp",
"sub": "375433",
"auth_time": 1496218762,
"idp": "local",
"acr": "3ohqhanw43vr3f25f5xek0s1",
"culture_name": "el-GR",
"jti": "398f0a6b7e0f60551f39cba8324a36eb",
"scope": [
"customAPI.read",
"customAPI.write",
"customAPI.read",
"customAPI.write",
"ScopeA",
"ScopeB",
"ScopeA",
"ScopeB"
],
"amr": [
"pwd"
]
}
Issue solved with this
Thanks! You saved me some time there.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.