@thunderid/react 0.0.4 → 0.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.
- package/README.md +1 -1
- package/dist/ThunderIDReactClient.d.ts +6 -43
- package/dist/ThunderIDReactClient.d.ts.map +1 -1
- package/dist/api/createOrganization.d.ts.map +1 -1
- package/dist/api/getAllOrganizations.d.ts.map +1 -1
- package/dist/api/getMeOrganizations.d.ts.map +1 -1
- package/dist/api/getOrganization.d.ts.map +1 -1
- package/dist/api/getSchemas.d.ts.map +1 -1
- package/dist/api/getScim2Me.d.ts.map +1 -1
- package/dist/api/updateMeProfile.d.ts.map +1 -1
- package/dist/api/updateOrganization.d.ts.map +1 -1
- package/dist/cjs/index.js +230 -731
- package/dist/cjs/index.js.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts +3 -2
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +226 -728
- package/dist/index.js.map +1 -1
- package/package.json +16 -10
- package/dist/__temp__/api.d.ts +0 -258
- package/dist/__temp__/api.d.ts.map +0 -1
- package/dist/__temp__/models.d.ts +0 -98
- package/dist/__temp__/models.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thunderid/react",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "React SDK for ThunderID",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"thunderid",
|
|
@@ -32,38 +32,44 @@
|
|
|
32
32
|
"directory": "sdks/react"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
+
"@emotion/css": "11.13.5",
|
|
36
|
+
"@floating-ui/react": "0.27.12",
|
|
35
37
|
"@testing-library/react": "16.3.0",
|
|
36
38
|
"@types/node": "24.7.2",
|
|
37
39
|
"@types/react": "19.2.14",
|
|
40
|
+
"@types/react-dom": "19.2.3",
|
|
41
|
+
"dompurify": "3.4.0",
|
|
38
42
|
"eslint": "9.39.4",
|
|
39
43
|
"prettier": "3.6.2",
|
|
40
44
|
"react": "19.2.3",
|
|
45
|
+
"react-dom": "19.2.3",
|
|
41
46
|
"rimraf": "6.1.3",
|
|
42
47
|
"rolldown": "1.0.0-beta.45",
|
|
43
48
|
"typescript": "5.9.3",
|
|
44
49
|
"vitest": "4.1.3",
|
|
45
|
-
"@thunderid/
|
|
46
|
-
"@thunderid/
|
|
50
|
+
"@thunderid/eslint-plugin": "^0.0.0",
|
|
51
|
+
"@thunderid/prettier-config": "^0.0.0"
|
|
47
52
|
},
|
|
48
53
|
"peerDependencies": {
|
|
49
54
|
"@types/react": ">=16.8.0",
|
|
50
|
-
"react": ">=16.8.0"
|
|
55
|
+
"react": ">=16.8.0",
|
|
56
|
+
"react-dom": ">=16.8.0"
|
|
51
57
|
},
|
|
52
58
|
"dependencies": {
|
|
53
59
|
"@emotion/css": "11.13.5",
|
|
54
60
|
"@floating-ui/react": "0.27.12",
|
|
55
|
-
"
|
|
56
|
-
"dompurify": "3.3.3",
|
|
57
|
-
"react-dom": "19.2.3",
|
|
61
|
+
"dompurify": "3.4.0",
|
|
58
62
|
"tslib": "2.8.1",
|
|
59
|
-
"@thunderid/browser": "^0.0
|
|
63
|
+
"@thunderid/browser": "^0.1.0"
|
|
60
64
|
},
|
|
61
65
|
"publishConfig": {
|
|
62
66
|
"access": "public"
|
|
63
67
|
},
|
|
64
68
|
"scripts": {
|
|
65
|
-
"build": "pnpm clean &&
|
|
66
|
-
"clean": "
|
|
69
|
+
"build": "pnpm clean:dist && node rolldown.config.js && tsc -p tsconfig.lib.json --emitDeclarationOnly --outDir dist",
|
|
70
|
+
"clean": "pnpm clean:node_modules && pnpm clean:dist",
|
|
71
|
+
"clean:dist": "rimraf dist",
|
|
72
|
+
"clean:node_modules": "rimraf node_modules",
|
|
67
73
|
"format:check": "prettier --check --cache .",
|
|
68
74
|
"format:fix": "prettier --write --cache .",
|
|
69
75
|
"lint": "eslint . --ext .js,.jsx,.ts,.tsx,.cjs,.mjs",
|
package/dist/__temp__/api.d.ts
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
-
*
|
|
4
|
-
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
import { ThunderIDSPAClient, AuthClientConfig, User, LegacyConfig as Config, IdToken, Hooks, HttpClient, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig, SPACustomGrantConfig } from '@thunderid/browser';
|
|
19
|
-
import { AuthStateInterface } from './models';
|
|
20
|
-
declare class AuthAPI {
|
|
21
|
-
static DEFAULT_STATE: AuthStateInterface;
|
|
22
|
-
private authState;
|
|
23
|
-
private client;
|
|
24
|
-
private apiInstanceId;
|
|
25
|
-
private loadingState;
|
|
26
|
-
constructor(spaClient?: ThunderIDSPAClient, instanceId?: number);
|
|
27
|
-
/**
|
|
28
|
-
* Get the instance ID for this AuthAPI instance.
|
|
29
|
-
* @returns The instance ID used for multi-auth context support.
|
|
30
|
-
*/
|
|
31
|
-
getInstanceId(): number;
|
|
32
|
-
setLoadingState(isLoading: boolean): void;
|
|
33
|
-
getLoadingState(): boolean;
|
|
34
|
-
isLoading(): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Method to return Auth Client instance authentication state.
|
|
37
|
-
*
|
|
38
|
-
* @return {AuthStateInterface} Authentication State.
|
|
39
|
-
*/
|
|
40
|
-
getState(): AuthStateInterface;
|
|
41
|
-
/**
|
|
42
|
-
* Method to initialize the AuthClient instance.
|
|
43
|
-
*
|
|
44
|
-
* @param {Config} config - `dispatch` function from React Auth Context.
|
|
45
|
-
*/
|
|
46
|
-
init(config: AuthClientConfig<Config>): Promise<boolean>;
|
|
47
|
-
/**
|
|
48
|
-
* Method to get the configuration data.
|
|
49
|
-
*
|
|
50
|
-
* @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.
|
|
51
|
-
*/
|
|
52
|
-
getConfigData(): Promise<AuthClientConfig<Config>>;
|
|
53
|
-
getStorageManager(): Promise<any>;
|
|
54
|
-
/**
|
|
55
|
-
* Method to get the configuration data.
|
|
56
|
-
*
|
|
57
|
-
* @returns {Promise<AuthClientConfig<Config>>} - A promise that resolves with the configuration data.
|
|
58
|
-
*/
|
|
59
|
-
isInitialized(): Promise<boolean>;
|
|
60
|
-
/**
|
|
61
|
-
* Method to handle user Sign In requests.
|
|
62
|
-
*
|
|
63
|
-
* @param {any} dispatch - `dispatch` function from React Auth Context.
|
|
64
|
-
* @param {AuthStateInterface} state - Current authentication state in React Auth Context.
|
|
65
|
-
* @param {any} callback - Action to trigger on successful sign in.
|
|
66
|
-
*/
|
|
67
|
-
signIn(config: SignInConfig, authorizationCode?: string, sessionState?: string, authState?: string, callback?: (response: User) => void, tokenRequestConfig?: {
|
|
68
|
-
params: Record<string, unknown>;
|
|
69
|
-
}): Promise<any>;
|
|
70
|
-
/**
|
|
71
|
-
* Method to handle user Sign Out requests.
|
|
72
|
-
*
|
|
73
|
-
* @param {any} dispatch - `dispatch` function from React Auth Context.
|
|
74
|
-
* @param {AuthStateInterface} state - Current authentication state in React Auth Context.
|
|
75
|
-
* @param {any} callback - Action to trigger on successful sign out.
|
|
76
|
-
*/
|
|
77
|
-
signOut(callback?: (response?: boolean) => void): Promise<boolean>;
|
|
78
|
-
/**
|
|
79
|
-
* Method to update Auth Client instance authentication state.
|
|
80
|
-
*
|
|
81
|
-
* @param {AuthStateInterface} state - State values to update in authentication state.
|
|
82
|
-
*/
|
|
83
|
-
updateState(state: AuthStateInterface): void;
|
|
84
|
-
/**
|
|
85
|
-
* This method returns a Promise that resolves with the basic user information obtained from the ID token.
|
|
86
|
-
*
|
|
87
|
-
* @return {Promise<User>} - A promise that resolves with the user information.
|
|
88
|
-
*/
|
|
89
|
-
getUser(): Promise<User>;
|
|
90
|
-
/**
|
|
91
|
-
* This method sends an API request to a protected endpoint.
|
|
92
|
-
* The access token is automatically attached to the header of the request.
|
|
93
|
-
* This is the only way by which protected endpoints can be accessed
|
|
94
|
-
* when the web worker is used to store session information.
|
|
95
|
-
*
|
|
96
|
-
* @param {HttpRequestConfig} config - The config object containing attributes necessary to send a request.
|
|
97
|
-
*
|
|
98
|
-
* @return {Promise<Response>} - Returns a Promise that resolves with the response to the request.
|
|
99
|
-
*/
|
|
100
|
-
httpRequest(config: HttpRequestConfig): Promise<HttpResponse<any>>;
|
|
101
|
-
/**
|
|
102
|
-
* This method sends multiple API requests to a protected endpoint.
|
|
103
|
-
* The access token is automatically attached to the header of the request.
|
|
104
|
-
* This is the only way by which multiple requests can be sent to protected endpoints
|
|
105
|
-
* when the web worker is used to store session information.
|
|
106
|
-
*
|
|
107
|
-
* @param {HttpRequestConfig[]} config - The config object containing attributes necessary to send a request.
|
|
108
|
-
*
|
|
109
|
-
* @return {Promise<Response>} - Returns a Promise that resolves with the responses to the requests.
|
|
110
|
-
*/
|
|
111
|
-
httpRequestAll(configs: HttpRequestConfig[]): Promise<HttpResponse<any>[]>;
|
|
112
|
-
/**
|
|
113
|
-
* This method allows you to send a request with a custom grant.
|
|
114
|
-
*
|
|
115
|
-
* @param {CustomGrantRequestParams} config - The request parameters.
|
|
116
|
-
*
|
|
117
|
-
* @return {Promise<Response | SignInResponse>} - A Promise that resolves with
|
|
118
|
-
* the value returned by the custom grant request.
|
|
119
|
-
*/
|
|
120
|
-
exchangeToken(config: SPACustomGrantConfig, callback: (response: User | Response) => void): Promise<User | Response>;
|
|
121
|
-
/**
|
|
122
|
-
* This method ends a user session. The access token is revoked and the session information is destroyed.
|
|
123
|
-
*
|
|
124
|
-
* @return {Promise<boolean>} - A promise that resolves with `true` if the process is successful.
|
|
125
|
-
*/
|
|
126
|
-
revokeAccessToken(dispatch: (state: AuthStateInterface) => void): Promise<boolean>;
|
|
127
|
-
/**
|
|
128
|
-
* This method returns a Promise that resolves with an object containing the service endpoints.
|
|
129
|
-
*
|
|
130
|
-
* @return {Promise<ServiceResourcesType} - A Promise that resolves with an object containing the service endpoints.
|
|
131
|
-
*/
|
|
132
|
-
getOpenIDProviderEndpoints(): Promise<OIDCEndpoints>;
|
|
133
|
-
/**
|
|
134
|
-
* This methods returns the Axios http client.
|
|
135
|
-
*
|
|
136
|
-
* @return {HttpClient} - The Axios HTTP client.
|
|
137
|
-
*/
|
|
138
|
-
getHttpClient(): Promise<HttpClient>;
|
|
139
|
-
/**
|
|
140
|
-
* This method decodes a JWT token payload and returns it.
|
|
141
|
-
*
|
|
142
|
-
* @param token - The token to decode.
|
|
143
|
-
* @returns The decoded token payload.
|
|
144
|
-
*/
|
|
145
|
-
decodeJwtToken<T = Record<string, unknown>>(token: string): Promise<T>;
|
|
146
|
-
/**
|
|
147
|
-
* This method decodes the payload of the id token and returns it.
|
|
148
|
-
*
|
|
149
|
-
* @return {Promise<DecodedIDTokenPayloadInterface>} - A Promise that resolves with
|
|
150
|
-
* the decoded payload of the id token.
|
|
151
|
-
*/
|
|
152
|
-
getDecodedIdToken(sessionId?: string): Promise<IdToken>;
|
|
153
|
-
/**
|
|
154
|
-
* This method decodes the payload of the idp id token and returns it.
|
|
155
|
-
*
|
|
156
|
-
* @return {Promise<DecodedIDTokenPayloadInterface>} - A Promise that resolves with
|
|
157
|
-
* the decoded payload of the idp id token.
|
|
158
|
-
*/
|
|
159
|
-
getDecodedIDPIDToken(): Promise<IdToken>;
|
|
160
|
-
/**
|
|
161
|
-
* This method returns the ID token.
|
|
162
|
-
*
|
|
163
|
-
* @return {Promise<string>} - A Promise that resolves with the id token.
|
|
164
|
-
*/
|
|
165
|
-
getIdToken(): Promise<string>;
|
|
166
|
-
/**
|
|
167
|
-
* This method return a Promise that resolves with the access token.
|
|
168
|
-
*
|
|
169
|
-
* **This method will not return the access token if the storage type is set to `webWorker`.**
|
|
170
|
-
*
|
|
171
|
-
* @return {Promise<string>} - A Promise that resolves with the access token.
|
|
172
|
-
*/
|
|
173
|
-
getAccessToken(sessionId?: string): Promise<string>;
|
|
174
|
-
/**
|
|
175
|
-
* This method return a Promise that resolves with the idp access token.
|
|
176
|
-
*
|
|
177
|
-
* **This method will not return the idp access token if the storage type is set to `webWorker`.**
|
|
178
|
-
* **This can be used to access the IDP access token when custom auth grant functionalities are used**
|
|
179
|
-
*
|
|
180
|
-
* @return {Promise<string>} - A Promise that resolves with the idp access token.
|
|
181
|
-
*/
|
|
182
|
-
getIDPAccessToken(): Promise<string>;
|
|
183
|
-
/**
|
|
184
|
-
* This method refreshes the access token.
|
|
185
|
-
*
|
|
186
|
-
* @return {TokenResponseInterface} - A Promise that resolves with an object containing
|
|
187
|
-
* information about the refreshed access token.
|
|
188
|
-
*/
|
|
189
|
-
refreshAccessToken(): Promise<User>;
|
|
190
|
-
/**
|
|
191
|
-
* This method specifies if the user is authenticated or not.
|
|
192
|
-
*
|
|
193
|
-
* @return {Promise<boolean>} - A Promise that resolves with `true` if teh user is authenticated.
|
|
194
|
-
*/
|
|
195
|
-
isSignedIn(): Promise<boolean>;
|
|
196
|
-
startAutoRefreshToken(): Promise<void>;
|
|
197
|
-
/**
|
|
198
|
-
* This method specifies if the session is active or not.
|
|
199
|
-
*
|
|
200
|
-
* @return {Promise<boolean>} - A Promise that resolves with `true` if there is an active session.
|
|
201
|
-
*/
|
|
202
|
-
isSessionActive(): Promise<boolean>;
|
|
203
|
-
/**
|
|
204
|
-
* This method enables callback functions attached to the http client.
|
|
205
|
-
*
|
|
206
|
-
* @return {Promise<boolean>} - A promise that resolves with True.
|
|
207
|
-
*
|
|
208
|
-
*/
|
|
209
|
-
enableHttpHandler(): Promise<boolean>;
|
|
210
|
-
/**
|
|
211
|
-
* This method disables callback functions attached to the http client.
|
|
212
|
-
*
|
|
213
|
-
* @return {Promise<boolean>} - A promise that resolves with True.
|
|
214
|
-
*/
|
|
215
|
-
disableHttpHandler(): Promise<boolean>;
|
|
216
|
-
/**
|
|
217
|
-
* This method updates the configuration that was passed into the constructor when instantiating this class.
|
|
218
|
-
*
|
|
219
|
-
* @param {Partial<AuthClientConfig<T>>} config - A config object to update the SDK configurations with.
|
|
220
|
-
*/
|
|
221
|
-
reInitialize(config: Partial<AuthClientConfig<Config>>): Promise<void>;
|
|
222
|
-
/**
|
|
223
|
-
* This method attaches a callback function to an event hook that fires the callback when the event happens.
|
|
224
|
-
*
|
|
225
|
-
* @param {Hooks.CustomGrant} hook - The name of the hook.
|
|
226
|
-
* @param {(response?: any) => void} callback - The callback function.
|
|
227
|
-
* @param {string} id (optional) - The id of the hook. This is used when multiple custom grants are used.
|
|
228
|
-
*
|
|
229
|
-
*/
|
|
230
|
-
on(hook: Hooks.CustomGrant, callback: (response?: any) => void, id: string): Promise<void>;
|
|
231
|
-
on(hook: Exclude<Hooks, Hooks.CustomGrant>, callback: (response?: any) => void): Promise<void>;
|
|
232
|
-
/**
|
|
233
|
-
* This method allows you to sign in silently.
|
|
234
|
-
* First, this method sends a prompt none request to see if there is an active user session in the identity server.
|
|
235
|
-
* If there is one, then it requests the access token and stores it. Else, it returns false.
|
|
236
|
-
*
|
|
237
|
-
* @return {Promise<User | boolean>} - A Promise that resolves with the user information after signing in
|
|
238
|
-
* or with `false` if the user is not signed in.
|
|
239
|
-
*
|
|
240
|
-
* @example
|
|
241
|
-
*```
|
|
242
|
-
* client.signInSilently()
|
|
243
|
-
*```
|
|
244
|
-
*/
|
|
245
|
-
signInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
|
|
246
|
-
params: Record<string, unknown>;
|
|
247
|
-
}): Promise<User | boolean | undefined>;
|
|
248
|
-
/**
|
|
249
|
-
* This method clears the session for the specified session ID.
|
|
250
|
-
*
|
|
251
|
-
* @param sessionId - Optional session ID to clear the session for.
|
|
252
|
-
*
|
|
253
|
-
* @return void
|
|
254
|
-
*/
|
|
255
|
-
clearSession(sessionId?: string): void;
|
|
256
|
-
}
|
|
257
|
-
export default AuthAPI;
|
|
258
|
-
//# sourceMappingURL=api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/__temp__/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,IAAI,EACJ,YAAY,IAAI,MAAM,EACtB,OAAO,EACP,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,oBAAoB,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAC,kBAAkB,EAAC,MAAM,UAAU,CAAC;AAE5C,cAAM,OAAO;IACX,MAAM,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAEzC,OAAO,CAAC,SAAS,CAA6C;IAE9D,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,aAAa,CAAS;IAE9B,OAAO,CAAC,YAAY,CAAU;gBAElB,SAAS,CAAC,EAAE,kBAAkB,EAAE,UAAU,SAAI;IAW1D;;;OAGG;IACI,aAAa,IAAI,MAAM;IAIvB,eAAe,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IAIzC,eAAe,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M,EAAE,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAInF;;;;;;;OAOG;IACI,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAC1F,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,CAAC,QAAQ,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IASrG;;;;;;;;;;;;OAYG;IACU,cAAc,CACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,EACnD,kBAAkB,CAAC,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC,GACrD,OAAO,CAAC,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;IAatC;;;;;;OAMG;IACI,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;CAG9C;AAUD,eAAe,OAAO,CAAC"}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
-
*
|
|
4
|
-
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
import { ThunderIDAuthException, AuthClientConfig, AuthSPAClientConfig, Config, TokenExchangeRequestConfig, IdToken, Hooks, HttpClient, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig, User } from '@thunderid/browser';
|
|
19
|
-
export interface ReactConfig {
|
|
20
|
-
disableAutoSignIn?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The `AuthProvider`, by default, looks for an active session in the server and updates the session information
|
|
23
|
-
* with the latest session information from the server. This option could be used to disable that behaviour.
|
|
24
|
-
*/
|
|
25
|
-
disableTrySignInSilently?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* The SDK's `AuthProvider` by default is listening to the URL changes to see
|
|
28
|
-
* if `code` & `session_state` search params are available so that it could perform
|
|
29
|
-
* token exchange. This option could be used to override that behaviour.
|
|
30
|
-
*/
|
|
31
|
-
skipRedirectCallback?: boolean;
|
|
32
|
-
}
|
|
33
|
-
export type AuthReactConfig = AuthSPAClientConfig & ReactConfig;
|
|
34
|
-
/**
|
|
35
|
-
* Interface for the Authenticated state of the user which is exposed
|
|
36
|
-
* via `state` object from `useAuthContext` hook.
|
|
37
|
-
*/
|
|
38
|
-
export interface AuthStateInterface {
|
|
39
|
-
/**
|
|
40
|
-
* The display name of the user.
|
|
41
|
-
*/
|
|
42
|
-
displayName?: string;
|
|
43
|
-
/**
|
|
44
|
-
* The email address of the user.
|
|
45
|
-
*/
|
|
46
|
-
email?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Are the Auth requests loading.
|
|
49
|
-
*/
|
|
50
|
-
isLoading: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Specifies if the user is authenticated or not.
|
|
53
|
-
*/
|
|
54
|
-
isSignedIn: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* The username of the user.
|
|
57
|
-
*/
|
|
58
|
-
username?: string;
|
|
59
|
-
}
|
|
60
|
-
export interface AuthContextInterface {
|
|
61
|
-
disableHttpHandler(): Promise<boolean>;
|
|
62
|
-
enableHttpHandler(): Promise<boolean>;
|
|
63
|
-
error: ThunderIDAuthException;
|
|
64
|
-
exchangeToken(config: TokenExchangeRequestConfig, callback?: (response: User | Response) => void): void;
|
|
65
|
-
getAccessToken(): Promise<string>;
|
|
66
|
-
getDecodedIDPIDToken(): Promise<IdToken>;
|
|
67
|
-
getDecodedIdToken(sessionId?: string): Promise<IdToken>;
|
|
68
|
-
getHttpClient(): Promise<HttpClient>;
|
|
69
|
-
getIdToken(): Promise<string>;
|
|
70
|
-
getOpenIDProviderEndpoints(): Promise<OIDCEndpoints>;
|
|
71
|
-
getUser(): Promise<User>;
|
|
72
|
-
httpRequest(config: HttpRequestConfig): Promise<HttpResponse<any>>;
|
|
73
|
-
httpRequestAll(configs: HttpRequestConfig[]): Promise<HttpResponse<any>[]>;
|
|
74
|
-
isSignedIn(): Promise<boolean>;
|
|
75
|
-
on(hook: Exclude<Hooks, Hooks.CustomGrant>, callback: (response?: any) => void): void;
|
|
76
|
-
on(hook: Hooks.CustomGrant, callback: (response?: any) => void, id: string): void;
|
|
77
|
-
on(hook: Hooks, callback: (response?: any) => void, id?: string): void;
|
|
78
|
-
reInitialize(config: Partial<AuthClientConfig<Config>>): Promise<void>;
|
|
79
|
-
refreshAccessToken(): Promise<User>;
|
|
80
|
-
revokeAccessToken(): Promise<boolean>;
|
|
81
|
-
signIn: (config?: SignInConfig, authorizationCode?: string, sessionState?: string, state?: string, callback?: (response: User) => void, tokenRequestConfig?: {
|
|
82
|
-
params: Record<string, unknown>;
|
|
83
|
-
}) => Promise<User>;
|
|
84
|
-
signInSilently: (additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
|
|
85
|
-
params: Record<string, unknown>;
|
|
86
|
-
}) => Promise<boolean | User>;
|
|
87
|
-
signOut: (callback?: (response: boolean) => void) => Promise<boolean>;
|
|
88
|
-
state: AuthStateInterface;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* The model of the object returned by the `getAuthParams` prop method of the `AuthProvider`.
|
|
92
|
-
*/
|
|
93
|
-
export interface AuthParams {
|
|
94
|
-
authorizationCode?: string;
|
|
95
|
-
sessionState?: string;
|
|
96
|
-
state?: string;
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/__temp__/models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,MAAM,EACN,0BAA0B,EAC1B,OAAO,EACP,KAAK,EACL,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,IAAI,EACL,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,WAAW;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAAG,WAAW,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,UAAU,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACtC,KAAK,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