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

[SDK-3613] Remove defaultScope and replace with just scope usage #972

Merged
merged 3 commits into from
Sep 6, 2022

Conversation

ewanharris
Copy link
Contributor

@ewanharris ewanharris commented Sep 6, 2022

Changes

This PR removes the advancedOptions.defaultScope option in favour of authorizationParams.scope. This allows the SDK to have a single place to set scopes when instantiating a new Client (although additional scopes can still be provided to the getToken* methods).

For those who were already providing a scope option, it should be updated as follows.

const client = new Auth0Client({
  domain: '<AUTH0_DOMAIN>',
  clientId: '<AUTH0_CLIENT_ID>',
- authorizationParams: {
-   scope: 'read:messages'
- }
+ authorizationParams: {
+   scope: 'profile email read:messages'
+ }
});

For those who were using advancedOptions.defaultScope you should merge advancedOptions.defaultScope with authorizationParams.scope:

const client = new Auth0Client({
  domain: '<AUTH0_DOMAIN>',
  clientId: '<AUTH0_CLIENT_ID>',
- authorizationParams: {
-   scope: 'read:messages'
- }
- advancedOptions: {
-   defaultScope: 'email'
- }
+ authorizationParams: {
+   scope: 'email read:messages'
+ }
});

Checklist

@ewanharris ewanharris requested a review from a team as a code owner September 6, 2022 09:53
frederikprijck
frederikprijck previously approved these changes Sep 6, 2022
@frederikprijck frederikprijck merged commit 4a307d3 into v2 Sep 6, 2022
@frederikprijck frederikprijck deleted the feat/SDK-3613 branch September 6, 2022 12:11
@frederikprijck frederikprijck mentioned this pull request Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants