cidaas-javascript-sdk 4.3.3 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +40 -4
  2. package/README.md +156 -94
  3. package/dist/authentication-service/AuthenticationService.d.ts +140 -0
  4. package/dist/authentication-service/AuthenticationService.js +210 -0
  5. package/dist/{authentication/Authentication.model.d.ts → authentication-service/AuthenticationService.model.d.ts} +18 -12
  6. package/dist/{authentication/Authentication.model.js → authentication-service/AuthenticationService.model.js} +2 -2
  7. package/dist/common/Common.model.d.ts +15 -19
  8. package/dist/common/Common.model.js +17 -17
  9. package/dist/common/ConfigUserProvider.d.ts +10 -0
  10. package/dist/common/ConfigUserProvider.js +28 -0
  11. package/dist/common/Helper.d.ts +7 -0
  12. package/dist/common/Helper.js +19 -0
  13. package/dist/common/User.model.d.ts +0 -4
  14. package/dist/consent-service/ConsentService.d.ts +99 -95
  15. package/dist/consent-service/ConsentService.js +125 -122
  16. package/dist/consent-service/ConsentService.model.d.ts +14 -16
  17. package/dist/device-service/DeviceService.d.ts +49 -0
  18. package/dist/device-service/DeviceService.js +79 -0
  19. package/dist/device-service/DeviceService.model.d.ts +6 -0
  20. package/dist/id-validation-service/IdValidationService.d.ts +28 -0
  21. package/dist/id-validation-service/IdValidationService.js +59 -0
  22. package/dist/id-validation-service/IdValidationService.model.d.ts +8 -0
  23. package/dist/id-validation-service/IdValidationService.model.js +2 -0
  24. package/dist/index.d.ts +22 -3
  25. package/dist/index.js +35 -18
  26. package/dist/login-service/LoginService.d.ts +143 -141
  27. package/dist/login-service/LoginService.js +255 -232
  28. package/dist/login-service/LoginService.model.d.ts +9 -51
  29. package/dist/login-service/LoginService.model.js +1 -1
  30. package/dist/public-service/PublicService.d.ts +57 -0
  31. package/dist/public-service/PublicService.js +73 -0
  32. package/dist/public-service/PublicService.model.d.ts +20 -0
  33. package/dist/public-service/PublicService.model.js +2 -0
  34. package/dist/token-service/TokenService.d.ts +104 -138
  35. package/dist/token-service/TokenService.js +164 -219
  36. package/dist/token-service/TokenService.model.d.ts +3 -44
  37. package/dist/token-service/TokenService.model.js +3 -16
  38. package/dist/user-service/UserService.d.ts +381 -315
  39. package/dist/user-service/UserService.js +552 -426
  40. package/dist/user-service/UserService.model.d.ts +48 -14
  41. package/dist/user-service/UserService.model.js +4 -4
  42. package/dist/verification-service/VerificationService.d.ts +281 -223
  43. package/dist/verification-service/VerificationService.js +343 -287
  44. package/dist/verification-service/VerificationService.model.d.ts +4 -5
  45. package/package.json +6 -4
  46. package/dist/authentication/Authentication.d.ts +0 -139
  47. package/dist/authentication/Authentication.js +0 -186
  48. package/dist/web-auth/WebAuth.d.ts +0 -665
  49. package/dist/web-auth/WebAuth.js +0 -955
  50. package/dist/web-auth/webauth.model.d.ts +0 -66
  51. /package/dist/{web-auth/webauth.model.js → device-service/DeviceService.model.js} +0 -0
@@ -9,234 +9,179 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.offlineTokenCheck = exports.deviceCodeVerify = exports.initiateDeviceCode = exports.getMissingFields = exports.loginPrecheck = exports.validateAccessToken = exports.getAccessToken = exports.renewToken = void 0;
12
+ exports.TokenService = void 0;
13
13
  const TokenService_model_1 = require("./TokenService.model");
14
14
  const Helper_1 = require("../common/Helper");
15
15
  const JwtHelper_1 = require("../common/JwtHelper");
16
- /**
17
- * To get a new token with the grant type refresh_token, call **renewToken()**.
18
- * The refresh token to create a new token. The refresh token is received while creating an access token using the token endpoint and later can be used to fetch a new token without using credentials
19
- * @example
20
- * ```js
21
- * const options = {
22
- * refresh_token: "your refresh token",
23
- * }
24
- *
25
- * cidaas.renewToken(options)
26
- * .then(function (response) {
27
- * // type your code here
28
- * })
29
- * .catch(function (ex) {
30
- * // your failure code here
31
- * });
32
- * ```
33
- */
34
- function renewToken(options) {
35
- if (!options.refresh_token) {
36
- throw new Helper_1.CustomException("refresh_token cannot be empty", 417);
16
+ class TokenService {
17
+ constructor(configUserProvider) {
18
+ this.config = configUserProvider.getConfig();
19
+ this.userManager = configUserProvider.getUserManager();
37
20
  }
38
- options.client_id = window.webAuthSettings.client_id;
39
- options.grant_type = TokenService_model_1.GrantType.RefreshToken;
40
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/token";
41
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
42
- }
43
- exports.renewToken = renewToken;
44
- /**
45
- * To get a new token with the grant type authorization_code, call **getAccessToken()** with code to create a new token.
46
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4ff850f48629a-generate-token for more details.
47
- * @example
48
- * ```js
49
- * const options = {
50
- * code: "your code to be exchanged with access token",
51
- * }
52
- *
53
- * cidaas.getAccessToken(options)
54
- * .then(function (response) {
55
- * // type your code here
56
- * })
57
- * .catch(function (ex) {
58
- * // your failure code here
59
- * });
60
- * ```
61
- */
62
- function getAccessToken(options) {
63
- var _a;
64
- return __awaiter(this, void 0, void 0, function* () {
65
- if (!options.code) {
66
- throw new Helper_1.CustomException("code cannot be empty", 417);
67
- }
68
- options.client_id = window.webAuthSettings.client_id;
69
- options.redirect_uri = window.webAuthSettings.redirect_uri;
70
- options.grant_type = TokenService_model_1.GrantType.AuthorizationCode;
71
- if (!window.webAuthSettings.disablePKCE) {
72
- const signInRequest = yield window.usermanager.getClient().createSigninRequest(window.webAuthSettings);
73
- options.code_verifier = (_a = signInRequest.state) === null || _a === void 0 ? void 0 : _a.code_verifier;
74
- }
75
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/token";
76
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
77
- });
78
- }
79
- exports.getAccessToken = getAccessToken;
80
- /**
81
- * To validate an access token, call **validateAccessToken()**.
82
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/26ff31e2937f1-introspect-with-bearer-token for more details.
83
- * @example
84
- * ```js
85
- * const options = {
86
- * token: "your access token",
87
- * token_type_hint: "accepted token type hints are access_token, id_token, refresh_token, sso",
88
- * }
89
- *
90
- * cidaas.validateAccessToken(options)
91
- * .then(function (response) {
92
- * // type your code here
93
- * })
94
- * .catch(function (ex) {
95
- * // your failure code here
96
- * });
97
- * ```
98
- */
99
- function validateAccessToken(options) {
100
- if (!options.token) {
101
- throw new Helper_1.CustomException("token cannot be empty", 417);
21
+ /**
22
+ * To generate token(s) with the grant type authorization_code, call **generateTokenFromCode()**
23
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/4ff850f48629a-generate-token for more details.
24
+ * @example
25
+ * ```js
26
+ * const options = {
27
+ * code: "your code to be exchanged with the token(s)",
28
+ * }
29
+ *
30
+ * cidaasTokenService.generateTokenFromCode(options)
31
+ * .then(function (response) {
32
+ * // type your code here
33
+ * })
34
+ * .catch(function (ex) {
35
+ * // your failure code here
36
+ * });
37
+ * ```
38
+ */
39
+ generateTokenFromCode(options) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ var _a;
42
+ if (!options.code) {
43
+ throw new Helper_1.CustomException("code cannot be empty", 417);
44
+ }
45
+ options.client_id = this.config.client_id;
46
+ options.redirect_uri = this.config.redirect_uri;
47
+ options.grant_type = TokenService_model_1.GrantType.AuthorizationCode;
48
+ if (!this.config.disablePKCE) {
49
+ const signInRequest = yield this.userManager.getClient().createSigninRequest(this.config);
50
+ options.code_verifier = (_a = signInRequest.state) === null || _a === void 0 ? void 0 : _a.code_verifier;
51
+ }
52
+ const _serviceURL = this.config.authority + "/token-srv/token";
53
+ return Helper_1.Helper.createHttpPromise(options, _serviceURL, undefined, "POST");
54
+ });
102
55
  }
103
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/introspect";
104
- return Helper_1.Helper.createHttpPromise(options, _serviceURL, false, "POST", options.token);
105
- }
106
- exports.validateAccessToken = validateAccessToken;
107
- /**
108
- * To get precheck result after login, call **loginPrecheck()**. If there is missing information, user will be redirected to either accepting consent, changing password, continuing MFA process, or do progressive registration
109
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.
110
- * @example
111
- * ```js
112
- * const options = {
113
- * trackId: "your track id from login",
114
- * locale: "your preferred locale. DEPRECATED as it is not supported anymore. Will be removed in next major release",
115
- * }
116
- *
117
- * cidaas.loginPrecheck(options)
118
- * .then(function (response) {
119
- * // type your code here
120
- * })
121
- * .catch(function (ex) {
122
- * // your failure code here
123
- * });
124
- * ```
125
- */
126
- function loginPrecheck(options, headers) {
127
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + options.track_id;
128
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
129
- }
130
- exports.loginPrecheck = loginPrecheck;
131
- /**
132
- * To get the missing fields after login, call **getMissingFields()**.
133
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.
134
- * @example
135
- * ```js
136
- * const trackId = "your track id from login";
137
- * cidaas.getMissingFields(trackId)
138
- * .then(function (response) {
139
- * // type your code here
140
- * })
141
- * .catch(function (ex) {
142
- * // your failure code here
143
- * });
144
- * ```
145
- */
146
- function getMissingFields(trackId, headers) {
147
- const _serviceURL = window.webAuthSettings.authority + "/token-srv/prelogin/metadata/" + trackId;
148
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
149
- }
150
- exports.getMissingFields = getMissingFields;
151
- /**
152
- * To initiate device code, call **initiateDeviceCode()**.
153
- * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/b6d284f55be5e-authorization-request for more details.
154
- * @example
155
- * ```js
156
- * const clientId = "your client id";
157
- * cidaas.initiateDeviceCode(clientId)
158
- * .then(function (response) {
159
- * // type your code here
160
- * })
161
- * .catch(function (ex) {
162
- * // your failure code here
163
- * });
164
- * ```
165
- */
166
- function initiateDeviceCode(clientId) {
167
- const clientid = clientId !== null && clientId !== void 0 ? clientId : window.webAuthSettings.client_id;
168
- const _serviceURL = `${window.webAuthSettings.authority}/authz-srv/device/authz?client_id=${clientid}`;
169
- return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
170
- }
171
- exports.initiateDeviceCode = initiateDeviceCode;
172
- /**
173
- * To verify device code, call **deviceCodeVerify()**.
174
- * @example
175
- * ```js
176
- * const code = "your code which has been send after initiateDeviceCode()";
177
- * cidaas.deviceCodeVerify(code)
178
- * .then(function (response) {
179
- * // type your code here
180
- * })
181
- * .catch(function (ex) {
182
- * // your failure code here
183
- * });
184
- * ```
185
- */
186
- function deviceCodeVerify(code) {
187
- const params = `user_code=${encodeURI(code)}`;
188
- const url = `${window.webAuthSettings.authority}/token-srv/device/verify?${params}`;
189
- try {
190
- const options = {
191
- user_code: encodeURI(code)
192
- };
193
- const form = Helper_1.Helper.createForm(url, options, 'GET');
194
- document.body.appendChild(form);
195
- form.submit();
56
+ /**
57
+ * To get precheck result after login, call **loginPrecheck()**. If there is missing information, user will be redirected to either accepting consent, changing password, continuing MFA process, or do progressive registration
58
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.
59
+ * @example
60
+ * ```js
61
+ * const options = {
62
+ * track_id: "your track id from login",
63
+ * }
64
+ *
65
+ * cidaasTokenService.loginPrecheck(options)
66
+ * .then(function (response) {
67
+ * // type your code here
68
+ * })
69
+ * .catch(function (ex) {
70
+ * // your failure code here
71
+ * });
72
+ * ```
73
+ */
74
+ loginPrecheck(options, headers) {
75
+ const _serviceURL = this.config.authority + "/token-srv/prelogin/metadata/" + options.track_id;
76
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
196
77
  }
197
- catch (ex) {
198
- throw new Error(String(ex));
78
+ /**
79
+ * To get the missing fields after login, call **getMissingFields()**.
80
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/aappczju1t3uh-precheck-information for more details.
81
+ * @example
82
+ * ```js
83
+ * const trackId = "your track id from login";
84
+ * cidaasTokenService.getMissingFields(trackId)
85
+ * .then(function (response) {
86
+ * // type your code here
87
+ * })
88
+ * .catch(function (ex) {
89
+ * // your failure code here
90
+ * });
91
+ * ```
92
+ */
93
+ getMissingFields(trackId, headers) {
94
+ const _serviceURL = this.config.authority + "/token-srv/prelogin/metadata/" + trackId;
95
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET", undefined, headers);
199
96
  }
200
- }
201
- exports.deviceCodeVerify = deviceCodeVerify;
202
- /**
203
- * To check access token without having to call cidaas api, call **offlineTokenCheck()**. THe function will return true if the token is valid & false if the token is invalid.
204
- * @example
205
- * ```js
206
- * cidaas.offlineTokenCheck('your access token');
207
- * ```
208
- */
209
- function offlineTokenCheck(accessToken) {
210
- var _a, _b;
211
- const result = {
212
- isExpiryDateValid: false,
213
- isScopesValid: false,
214
- isIssuerValid: false,
215
- };
216
- const accessTokenHeaderAsJson = JwtHelper_1.JwtHelper.decodeTokenHeader(accessToken);
217
- const accessTokenAsJson = JwtHelper_1.JwtHelper.decodeToken(accessToken);
218
- if (!accessTokenAsJson || !accessTokenHeaderAsJson) {
219
- return result;
97
+ /**
98
+ * To initiate device code, call **initiateDeviceCode()**.
99
+ * Please refer to the api document https://docs.cidaas.com/docs/cidaas-iam/b6d284f55be5e-authorization-request for more details.
100
+ * @example
101
+ * ```js
102
+ * const clientId = "your client id";
103
+ * cidaasTokenService.initiateDeviceCode(clientId)
104
+ * .then(function (response) {
105
+ * // type your code here
106
+ * })
107
+ * .catch(function (ex) {
108
+ * // your failure code here
109
+ * });
110
+ * ```
111
+ */
112
+ initiateDeviceCode(clientId) {
113
+ const clientid = clientId !== null && clientId !== void 0 ? clientId : this.config.client_id;
114
+ const _serviceURL = `${this.config.authority}/authz-srv/device/authz?client_id=${clientid}`;
115
+ return Helper_1.Helper.createHttpPromise(undefined, _serviceURL, false, "GET");
116
+ }
117
+ /**
118
+ * To verify device code, call **deviceCodeVerify()**.
119
+ * @example
120
+ * ```js
121
+ * const code = "your code which has been send after initiateDeviceCode()";
122
+ * cidaasTokenService.deviceCodeVerify(code)
123
+ * .then(function (response) {
124
+ * // type your code here
125
+ * })
126
+ * .catch(function (ex) {
127
+ * // your failure code here
128
+ * });
129
+ * ```
130
+ */
131
+ deviceCodeVerify(code) {
132
+ const params = `user_code=${encodeURI(code)}`;
133
+ const url = `${this.config.authority}/token-srv/device/verify?${params}`;
134
+ try {
135
+ const options = {
136
+ user_code: encodeURI(code)
137
+ };
138
+ const form = Helper_1.Helper.createForm(url, options, 'GET');
139
+ document.body.appendChild(form);
140
+ form.submit();
141
+ }
142
+ catch (ex) {
143
+ throw new Error(String(ex));
144
+ }
220
145
  }
221
- else {
222
- if (accessTokenAsJson.exp) {
223
- const expirationDate = new Date(0);
224
- expirationDate.setUTCSeconds(accessTokenAsJson.exp);
225
- result.isExpiryDateValid = expirationDate.valueOf() > new Date().valueOf();
146
+ /**
147
+ * To check access token without having to call cidaas api, call **offlineTokenCheck()**. THe function will return true if the token is valid & false if the token is invalid.
148
+ * @example
149
+ * ```js
150
+ * cidaasTokenService.offlineTokenCheck('your access token');
151
+ * ```
152
+ */
153
+ offlineTokenCheck(accessToken) {
154
+ var _a, _b;
155
+ const result = {
156
+ isExpiryDateValid: false,
157
+ isScopesValid: false,
158
+ isIssuerValid: false,
159
+ };
160
+ const accessTokenHeaderAsJson = JwtHelper_1.JwtHelper.decodeTokenHeader(accessToken);
161
+ const accessTokenAsJson = JwtHelper_1.JwtHelper.decodeToken(accessToken);
162
+ if (!accessTokenAsJson || !accessTokenHeaderAsJson) {
163
+ return result;
226
164
  }
227
- const accessTokenScopes = accessTokenAsJson.scopes;
228
- const webAuthSettingScopes = (_b = (_a = window.webAuthSettings) === null || _a === void 0 ? void 0 : _a.scope) === null || _b === void 0 ? void 0 : _b.split(' ');
229
- if ((accessTokenScopes === null || accessTokenScopes === void 0 ? void 0 : accessTokenScopes.length) === (webAuthSettingScopes === null || webAuthSettingScopes === void 0 ? void 0 : webAuthSettingScopes.length)) {
230
- webAuthSettingScopes.forEach(webAuthSettingScope => {
231
- const i = accessTokenScopes.indexOf(webAuthSettingScope);
232
- if (i > -1) {
233
- accessTokenScopes.splice(i, 1);
234
- }
235
- });
236
- result.isScopesValid = accessTokenScopes.length === 0;
165
+ else {
166
+ if (accessTokenAsJson.exp) {
167
+ const expirationDate = new Date(0);
168
+ expirationDate.setUTCSeconds(accessTokenAsJson.exp);
169
+ result.isExpiryDateValid = expirationDate.valueOf() > new Date().valueOf();
170
+ }
171
+ const accessTokenScopes = accessTokenAsJson.scopes;
172
+ const configScopes = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.scope) === null || _b === void 0 ? void 0 : _b.split(' ');
173
+ if ((accessTokenScopes === null || accessTokenScopes === void 0 ? void 0 : accessTokenScopes.length) === (configScopes === null || configScopes === void 0 ? void 0 : configScopes.length)) {
174
+ configScopes.forEach(scope => {
175
+ const i = accessTokenScopes.indexOf(scope);
176
+ if (i > -1) {
177
+ accessTokenScopes.splice(i, 1);
178
+ }
179
+ });
180
+ result.isScopesValid = accessTokenScopes.length === 0;
181
+ }
182
+ result.isIssuerValid = accessTokenAsJson.iss === this.config.authority;
237
183
  }
238
- result.isIssuerValid = accessTokenAsJson.iss === window.webAuthSettings.authority;
184
+ return result;
239
185
  }
240
- return result;
241
186
  }
242
- exports.offlineTokenCheck = offlineTokenCheck;
187
+ exports.TokenService = TokenService;
@@ -49,12 +49,6 @@ export interface TokenClaim {
49
49
  ua_hash?: string;
50
50
  /** List of unaccepted consents */
51
51
  consents?: Consent[];
52
- /** DEPRECATED: replaced with aud claim */
53
- clientid?: string;
54
- /** DEPRECATED: replaced with scopes claim */
55
- scope?: string;
56
- /** DEPRECATED: replaced with roles claim */
57
- role?: string;
58
52
  }
59
53
  export interface Group {
60
54
  /** Unique identifier for the group */
@@ -72,17 +66,6 @@ export interface Consent {
72
66
  /** Time when the consent is created */
73
67
  creation_time: string;
74
68
  }
75
- export interface RenewTokenRequest {
76
- /** One time valid code that is used for issuing a new token */
77
- refresh_token: string;
78
- /** Unique identifier of client app, can be found in app setting under admin ui */
79
- client_id?: string;
80
- /**
81
- * Type of grant used in token request
82
- * BREAKING TODO: change type to GrantType only in next major version
83
- */
84
- grant_type?: GrantType | string;
85
- }
86
69
  /** Type of grant used in token request */
87
70
  export declare enum GrantType {
88
71
  AuthorizationCode = "authorization_code",
@@ -93,7 +76,7 @@ export declare enum GrantType {
93
76
  Internal = "internal",
94
77
  DeviceCode = "urn:ietf:params:oauth:grant-type:device_code"
95
78
  }
96
- export interface GetAccessTokenRequest {
79
+ export interface GenerateTokenFromCodeRequest {
97
80
  /** The code which you receive while using authorization code flow */
98
81
  code: string;
99
82
  /** When we choose PKCE method to generate token, we need to pass code_verifier which is a cryptographically random string */
@@ -102,35 +85,11 @@ export interface GetAccessTokenRequest {
102
85
  client_id?: string;
103
86
  /**
104
87
  * Type of grant used in token request
105
- * BREAKING TODO: change type to GrantType only in next major version
106
- * */
107
- grant_type?: GrantType | string;
88
+ */
89
+ grant_type?: GrantType;
108
90
  /** Specify the url where the user needs to be redirected after successful login */
109
91
  redirect_uri?: string;
110
92
  }
111
- export declare class TokenIntrospectionRequest {
112
- /** access token to be inspected */
113
- token: string;
114
- /**
115
- * Optional hint about the type of the submitted token.
116
- * BREAKING TODO: change type to TokenTypeHint only in next major version
117
- * */
118
- token_type_hint?: TokenTypeHint | string;
119
- /** List of roles to match */
120
- roles?: string[];
121
- /** List of scopes to match */
122
- scopes?: string[];
123
- /** List of groups to match */
124
- groups?: GroupAllowed[];
125
- /** If true, all roles have to be included. If false, only 1 role from the list is needed */
126
- strictRoleValidation?: boolean;
127
- /** If true, all group have to be included. If false, only 1 group from the list is needed */
128
- strictGroupValidation?: boolean;
129
- /** If true, all scopes have to be included. If false, only 1 scope from the list is needed */
130
- strictScopeValidation?: boolean;
131
- /** If true, all defined roles and/or groups and/or scopes validation has to be succesful. If false, only 1 of them is needed */
132
- strictValidation?: boolean;
133
- }
134
93
  /** Optional hint about the type of the submitted token. */
135
94
  export declare enum TokenTypeHint {
136
95
  AccessToken = "access_token",
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GroupAllowed = exports.TokenTypeHint = exports.TokenIntrospectionRequest = exports.GrantType = void 0;
3
+ exports.GroupAllowed = exports.TokenTypeHint = exports.GrantType = void 0;
4
4
  /** Type of grant used in token request */
5
5
  var GrantType;
6
6
  (function (GrantType) {
@@ -11,20 +11,7 @@ var GrantType;
11
11
  GrantType["ClientCredentials"] = "client_credentials";
12
12
  GrantType["Internal"] = "internal";
13
13
  GrantType["DeviceCode"] = "urn:ietf:params:oauth:grant-type:device_code";
14
- })(GrantType = exports.GrantType || (exports.GrantType = {}));
15
- class TokenIntrospectionRequest {
16
- constructor() {
17
- /** If true, all roles have to be included. If false, only 1 role from the list is needed */
18
- this.strictRoleValidation = false;
19
- /** If true, all group have to be included. If false, only 1 group from the list is needed */
20
- this.strictGroupValidation = false;
21
- /** If true, all scopes have to be included. If false, only 1 scope from the list is needed */
22
- this.strictScopeValidation = false;
23
- /** If true, all defined roles and/or groups and/or scopes validation has to be succesful. If false, only 1 of them is needed */
24
- this.strictValidation = false;
25
- }
26
- }
27
- exports.TokenIntrospectionRequest = TokenIntrospectionRequest;
14
+ })(GrantType || (exports.GrantType = GrantType = {}));
28
15
  /** Optional hint about the type of the submitted token. */
29
16
  var TokenTypeHint;
30
17
  (function (TokenTypeHint) {
@@ -33,7 +20,7 @@ var TokenTypeHint;
33
20
  TokenTypeHint["IdToken"] = "id_token";
34
21
  TokenTypeHint["Sid"] = "sid";
35
22
  TokenTypeHint["Sso"] = "sso";
36
- })(TokenTypeHint = exports.TokenTypeHint || (exports.TokenTypeHint = {}));
23
+ })(TokenTypeHint || (exports.TokenTypeHint = TokenTypeHint = {}));
37
24
  class GroupAllowed {
38
25
  constructor() {
39
26
  /** If true, all roles have to be included. If false, only 1 role from the list is needed */