Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Implement Authorization #30

Open
geeksnodes opened this issue Aug 30, 2017 · 0 comments
Open

Implement Authorization #30

geeksnodes opened this issue Aug 30, 2017 · 0 comments

Comments

@geeksnodes
Copy link

How can i implement Authorization claim based . I have tried but not working properly if i generate 2 token first for 'Administrator' and second for 'User'. the last token also getting the previous role. find the below code.
In TokenProviderMiddleware.cs class.

  var claims = new Claim[]
                {
                new Claim(JwtRegisteredClaimNames.Sub, username),
                new Claim(JwtRegisteredClaimNames.Jti, await _options.NonceGenerator())
                ,new Claim("roles",role)
                ,new Claim("userId",userId)
                    //  new Claim(JwtRegisteredClaimNames.Iat, ToUnixEpochDate(now).ToString(), ClaimValueTypes.Integer64)
                };
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant