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(office365): add tenant specific parameter #71

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

iguissouma
Copy link

This pull request add a tenantId value as an option for office365 oauth that can be used to control who can sign into the application.
The allowed values are tenant identifiers, for example, 8eaef023-2b34-4da1-9baa-8bc8c9d6a490 or contoso.onmicrosoft.com or common for tenant-independent tokens which is the default value.

The new option can be used as below

var o365InitOptions: tnsOAuthModule.ITnsOAuthOptionsOffice365 = {
    tenantId: 'contoso.onmicrosoft.com',//specific tenant id
    clientId: '61f851ae-3b42-4ef9-8c11-xxxxxxxxxxxxx', //client id for application (GUID)
    scope: ['Files.ReadWrite', 'User.ReadWrite', 'offline_access']
};
tnsOAuthModule.initOffice365(o365InitOptions);

This will allow to use the authorizeEndpoint as https://login.microsoftonline.com/contoso.onmicrosoft.com/oauth2/v2.0/authorize and the tokenEndpoint as https://login.microsoftonline.com/contoso.onmicrosoft.com/oauth2/v2.0/token for the OAuth 2.0 authorization flow.

If no tenantId is specified the common endpoint is used by default.

Thanks for the plugin.

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.

1 participant