1.1.18 • Published 9 months ago

@rc-ex/authorize-uri v1.1.18

Weekly downloads
26
License
MIT
Repository
github
Last release
9 months ago

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

Ref: https://medium.com/ringcentral-developers/use-authorization-code-pkce-for-ringcentral-api-in-client-app-e9108f04b5f0

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.

1.1.18

9 months ago

1.1.16

1 year ago

1.1.17

10 months ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.12

1 year ago

1.1.13

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.1

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.5-alpha.0

2 years ago

1.0.4-alpha.0

2 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha.0

3 years ago

1.0.2-alpha.0

2 years ago

1.0.1-alpha.0

2 years ago

1.0.3-alpha.0

2 years ago

0.9.3

3 years ago

0.9.2

3 years ago

0.9.0

3 years ago

0.9.1

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.20

4 years ago

0.7.19

4 years ago

0.7.18

4 years ago

0.7.17

4 years ago

0.7.16

4 years ago

0.7.15

4 years ago

0.7.14

4 years ago

0.7.12

4 years ago

0.7.11

4 years ago

0.7.10

4 years ago

0.7.9

4 years ago

0.7.8

4 years ago

0.7.7

4 years ago

0.7.6

4 years ago

0.7.5

4 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.6.10

4 years ago

0.6.11

4 years ago

0.7.1

4 years ago

0.7.0

4 years ago

0.6.9

4 years ago

0.6.8

4 years ago

0.6.7

4 years ago

0.6.6

5 years ago

0.6.5

5 years ago

0.6.3

5 years ago

0.6.4

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.9

5 years ago

0.5.8

5 years ago

0.5.7

5 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago