samples-js-react icon indicating copy to clipboard operation
samples-js-react copied to clipboard

:seedling: Add custom scopes to authorisation request

Open kelvin-chappell opened this issue 3 years ago • 4 comments

This change enables the Okta-hosted login app to request additional custom access scopes when authorising.

Custom scopes can now be added as an optional property called CUSTOM_SCOPES in the testenv property file. Each scope is space separated. Eg.

CUSTOM_SCOPES=read write

These scopes are then added to the default list and included in the token request.

kelvin-chappell avatar Oct 28 '22 11:10 kelvin-chappell

@jaredperreault-okta can you give this a review and merge if you're happy please?

Mark-McCracken avatar Feb 02 '23 01:02 Mark-McCracken

@kelvin-chappell @Mark-McCracken Do you mind explaining your use case?

jaredperreault-okta avatar Feb 06 '23 17:02 jaredperreault-okta

@kelvin-chappell @Mark-McCracken Do you mind explaining your use case?

At the moment, if you need to generate an access token with more than the default access scopes configured here you have to search through the code and add them to that array. By making this a configurable environment variable we improve the dev experience and make it very easy to see, and modify, what scopes have been requested with the token.

kelvin-chappell avatar Feb 07 '23 08:02 kelvin-chappell

@jaredperreault-okta I've been using this for the last few days, which has been helpful for getting certain kinds of access tokens. Do you need anything to get this merged?

Mark-McCracken avatar Feb 09 '23 14:02 Mark-McCracken