Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing Claims and Identity Info with IdentityServer v3

I have IdentityServer with Membership Reboot and IdentityManager running on a remote server, I've used the Admin UI of IdentityManager to setup a user, and add roles & claims to said user.

I'm developing a WebApi/SPA project that will use the remote server for Auth. Using fiddler I can request a token from the IdentityManagner on the remote box and use this token to against the local WebApi where Authorization is required. If the token is valid the WebApi processes like normal, if the token is bogus I get a 401. Works great.

The problem is when I want additional information about the user none of the claims or identity information is coming across. I'm not sure if the problem is at the IdentityServer side, The WebApi side, or if I'm not doing something correctly when getting my token.

like image 397
stroebele Avatar asked Nov 28 '25 12:11

stroebele


1 Answers

I didn't realize we needed put the claims in the Scope definition. Incase anyone else stumbles upon this I changed my scope to the following

   var scopes = new List<Scope>
    {
        new Scope
        {
            Enabled = true,
            Name = "publicApi",
            Description = "Access to our public API",
            Type = ScopeType.Resource,
            IncludeAllClaimsForUser = true, //I'll filter this down later
        }
    };
    scopes.AddRange(StandardScopes.All);

    return scopes;

Further details can be found here

like image 93
stroebele Avatar answered Nov 30 '25 06:11

stroebele



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!