Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: simplify up-scoping or down-scoping of scopes overwriteAccessTokenScopes() #1218

Closed
yuriyz opened this issue Apr 19, 2022 · 1 comment
Assignees
Labels
comp-jans-auth-server Component affected by issue or PR kind-enhancement Issue or PR is an enhancement to an existing functionality kind-feature Issue or PR is a new feature request triaged Issue or PR is fully triaged
Milestone

Comments

@yuriyz
Copy link
Contributor

yuriyz commented Apr 19, 2022

Description

With UpdateTokenType script we can do up-scoping or down-scoping tokens. However it can be not trivial to code the script. We should introduce context.overwriteAccessTokenScopes("<new scopes>").

Scatch of code that would have to be written without it

 def modifyAccessToken(self, accessToken, context):
        previousGrant = context.getGrant()
        originalScopes = previousGrant.getScopes()

        # overwrite scope
        context.getAccessTokenEntity().setScope("myscope")
        accessToken.setCode("<regenerate JWT here if it is AT as JWT>");
        return True
@yuriyz yuriyz added kind-enhancement Issue or PR is an enhancement to an existing functionality comp-jans-auth-server Component affected by issue or PR triaged Issue or PR is fully triaged labels Apr 19, 2022
@yuriyz yuriyz self-assigned this Apr 19, 2022
@mo-auto mo-auto added the kind-feature Issue or PR is a new feature request label Apr 19, 2022
@moabu moabu added this to the 1.0.1 milestone Jun 15, 2022
yuriyz added a commit that referenced this issue Jun 24, 2022
feat(jans-auth-server): added convenient method for up-scoping or down-scoping AT scopes #1218
@yuriyz
Copy link
Contributor Author

yuriyz commented Jun 24, 2022

Done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-jans-auth-server Component affected by issue or PR kind-enhancement Issue or PR is an enhancement to an existing functionality kind-feature Issue or PR is a new feature request triaged Issue or PR is fully triaged
Projects
None yet
Development

No branches or pull requests

3 participants