@rc-ex/authorize-uri v1.1.15
Authorize URI Extension
Generate Authorize URI.
Install
yarn add @rc-ex/authorize-uri
Usage
import RingCentral from '@rc-ex/core';
import AuthorizeUriExtension from '@rc-ex/authorize-uri';
const rc = new RingCentral(...);
const authorizeUriExtension = new AuthorizeUriExtension();
await rc.installExtension(authorizeUriExtension);
const authorizeUri = authorizeUriExtension.buildUri({
state: 'hello',
redirect_uri: 'https://example.com',
});
For a working sample, please check this test case.
PKCE
First and foremost, you should not specify client secret in your project, that's the whole point of PKCE.
Secondly, specify code_challenge_method: 'S256'
:
const authorizeUri = authorizeUriExtension.buildUri({
state: 'hello',
redirect_uri: 'https://example.com',
code_challenge_method: 'S256',
});
And you should save the codeVerifier
:
const codeVerifier = authorizeUriExtension.codeVerifier;
You may need to persist codeVerifier
in case browser web page refreshes.
And when you make the authorize API call, remember to specify code_verifier
:
await rc.authorize({
code: '...',
redirect_uri: '...',
code_verifier: codeVerifier,
});
PKCE demo
Base Authorization URI
Optionally, you can specify baseAuthorizationUri
as parameter to the constructor of this extension.
If it's not specified, ${rc.rest.server}/restapi/oauth/authorize
is used as baseAuthorizationUri
.
14 days ago
17 days ago
24 days ago
24 days ago
1 month ago
2 months ago
2 months ago
3 months ago
4 months ago
4 months ago
4 months ago
7 months ago
8 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago