forked from KKBOX/OpenAPI-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuth.js
More file actions
26 lines (24 loc) · 684 Bytes
/
Copy pathAuth.js
File metadata and controls
26 lines (24 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import ClientCredentialsFlow from './ClientCredentialsFlow';
import TokenFetcher from './TokenFetcher';
/**
* Implements various KKBOX OAuth 2.0 authorization flows.
*/
export default class Auth {
/**
* Initialize the Auth object with client id and client secret.
*
* @param {string} clientID
* @param {string} clientSecret
* @example new Auth(clientID, clientSecret);
*/
constructor(clientID, clientSecret) {
/**
* @type {TokenFetcher}
*/
this.tokenFetcher = new TokenFetcher(clientID, clientSecret);
/**
* @type {ClientCredentialsFlow}
*/
this.clientCredentialsFlow = new ClientCredentialsFlow(this.tokenFetcher);
}
}