IdentityServer4
IdentityServer4 copied to clipboard
adding ScopeClaim in new Resource-based Configuration
How to add ScopeClaim in new Resource-based Configuration? I have read the blog post https://leastprivilege.com/2016/12/01/new-in-identityserver4-resource-based-configuration/ but don't fully understand. My old code was
public static IEnumerable<Scope> GetScopes()
{
return new List<Scope>
{
StandardScopes.OpenId,
StandardScopes.Profile,
StandardScopes.Email,
StandardScopes.OfflineAccess,
new Scope
{
Name = "myApi",
DisplayName = "myApi access",
Description = "myApi",
Claims = new List<ScopeClaim>
{
new ScopeClaim("companyCode", alwaysInclude: true)
}
}
};
}
but in the new model where and how to put companyCode? I have tried creating customProfile, but when looking into token with jwt.io it is not there.
new ApiResource("myApi", "My Api")
{
UserClaims = { "companyCode" }
},
Thank you.
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.