You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Box API key used for identifying the application the user is authenticating with */
14
16
readonlyclientId!: string;
17
+
/**
18
+
* Box API secret used for making auth requests. */
15
19
readonlyclientSecret!: string;
20
+
/**
21
+
* The ID of the Box Developer Edition enterprise. */
16
22
readonlyenterpriseId?: string;
23
+
/**
24
+
* The user id to authenticate. This value is not required. But if it is provided, then the user will be auto-authenticated at the time of the first API call. */
17
25
readonlyuserId?: string;
26
+
/**
27
+
* Object responsible for storing token. If no custom implementation provided,the token will be stored in memory. */
* Box API key used for identifying the application the user is authenticating with */
41
53
readonlyclientId: string;
54
+
/**
55
+
* Box API secret used for making auth requests. */
42
56
readonlyclientSecret: string;
57
+
/**
58
+
* The ID of the Box Developer Edition enterprise. */
43
59
readonlyenterpriseId?: string;
60
+
/**
61
+
* The user id to authenticate. This value is not required. But if it is provided, then the user will be auto-authenticated at the time of the first API call. */
44
62
readonlyuserId?: string;
63
+
/**
64
+
* Object responsible for storing token. If no custom implementation provided,the token will be stored in memory. */
45
65
readonlytokenStorage?: TokenStorage;
46
66
}
47
67
exportclassBoxCcgAuthimplementsAuthentication{
68
+
/**
69
+
* Configuration object of Client Credentials Grant auth. */
48
70
readonlyconfig!: CcgConfig;
71
+
/**
72
+
* An object responsible for storing token. If no custom implementation provided, the token will be stored in memory. */
49
73
readonlytokenStorage: TokenStorage;
74
+
/**
75
+
* The ID of the user or enterprise to authenticate as. If not provided, defaults to the enterprise ID if set, otherwise defaults to the user ID. */
50
76
readonlysubjectId?: string;
77
+
/**
78
+
* The type of the subject ID provided. Must be either 'user' or 'enterprise'. */
* Create a new BoxCCGAuth instance that uses the provided user ID as the subject ID.
152
+
* May be one of this application's created App User. Depending on the configured User Access Level, may also be any other App User or Managed User in the enterprise.
* @param {string} userId The id of the user to authenticate
156
+
* @param {TokenStorage} tokenStorage Object responsible for storing token in newly created BoxCCGAuth. If no custom implementation provided, the token will be stored in memory.
@@ -118,6 +169,12 @@ export class BoxCcgAuth implements Authentication {
118
169
});
119
170
returnnewBoxCcgAuth({config: newConfig});
120
171
}
172
+
/**
173
+
* Create a new BoxCCGAuth instance that uses the provided enterprise ID as the subject ID.
174
+
* @param {string} enterpriseId The id of the enterprise to authenticate
175
+
* @param {TokenStorage} tokenStorage Object responsible for storing token in newly created BoxCCGAuth. If no custom implementation provided, the token will be stored in memory.
@@ -131,6 +188,14 @@ export class BoxCcgAuth implements Authentication {
131
188
});
132
189
returnnewBoxCcgAuth({config: newConfig});
133
190
}
191
+
/**
192
+
* Downscope access token to the provided scopes. Returning a new access token with the provided scopes, with the original access token unchanged.
193
+
* @param {readonly string[]} scopes The scope(s) to apply to the resulting token.
194
+
* @param {string} resource The file or folder to get a downscoped token for. If None and shared_link None, the resulting token will not be scoped down to just a single item. The resource should be a full URL to an item, e.g. https://api.box.com/2.0/files/123456.
195
+
* @param {string} sharedLink The shared link to get a downscoped token for. If None and item None, the resulting token will not be scoped down to just a single item.
196
+
* @param {NetworkSession} networkSession An object to keep network session state
197
+
* @returns {Promise<AccessToken>}
198
+
*/
134
199
asyncdownscopeToken(
135
200
scopes: readonlystring[],
136
201
resource?: string,
@@ -161,6 +226,11 @@ export class BoxCcgAuth implements Authentication {
161
226
}satisfiesPostOAuth2Token);
162
227
returndownscopedToken;
163
228
}
229
+
/**
230
+
* Revoke the current access token and remove it from token storage.
231
+
* @param {NetworkSession} networkSession An object to keep network session state
@@ -76,6 +99,14 @@ export class BoxDeveloperTokenAuth implements Authentication {
76
99
awaitthis.tokenStorage.clear();
77
100
returnvoid0;
78
101
}
102
+
/**
103
+
* Downscope access token to the provided scopes. Returning a new access token with the provided scopes, with the original access token unchanged.
104
+
* @param {readonly string[]} scopes The scope(s) to apply to the resulting token.
105
+
* @param {string} resource The file or folder to get a downscoped token for. If None and shared_link None, the resulting token will not be scoped down to just a single item. The resource should be a full URL to an item, e.g. https://api.box.com/2.0/files/123456.
106
+
* @param {string} sharedLink The shared link to get a downscoped token for. If None and item None, the resulting token will not be scoped down to just a single item.
107
+
* @param {NetworkSession} networkSession An object to keep network session state
0 commit comments