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

Implement Authorization #30

@sumitstacks

Description

@sumitstacks

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)
                };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions