1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 | export as namespace auth0;
|
13 |
|
14 | export class Authentication {
|
15 | constructor(options: AuthOptions);
|
16 |
|
17 | passwordless: PasswordlessAuthentication;
|
18 | dbConnection: DBConnection;
|
19 |
|
20 | /**
|
21 | * Builds and returns the `/authorize` url in order to initialize a new authN/authZ transaction
|
22 | *
|
23 | * @param options: https://auth0.github.io/auth0.js/global.html#buildAuthorizeUrl
|
24 | * @see {@link https:
|
25 | * @see {@link https:
|
26 | */
|
27 | buildAuthorizeUrl(options: AuthorizeUrlOptions): string;
|
28 |
|
29 | |
30 |
|
31 |
|
32 |
|
33 |
|
34 | buildLogoutUrl(options?: LogoutOptions): string;
|
35 |
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 | loginWithDefaultDirectory(options: DefaultDirectoryLoginOptions, callback: Auth0Callback<any>): void;
|
42 |
|
43 | |
44 |
|
45 |
|
46 |
|
47 | loginWithResourceOwner(options: ResourceOwnerLoginOptions, callback: Auth0Callback<any>): void;
|
48 |
|
49 | |
50 |
|
51 |
|
52 | login(options: DefaultLoginOptions, callback: Auth0Callback<any>): void;
|
53 |
|
54 | |
55 |
|
56 |
|
57 | oauthToken(options: any, callback: Auth0Callback<any>): void;
|
58 |
|
59 | |
60 |
|
61 |
|
62 |
|
63 | getSSOData(callback?: Auth0Callback<SsoDataResult | undefined>): void;
|
64 |
|
65 | |
66 |
|
67 |
|
68 |
|
69 | getSSOData(withActiveDirectories: boolean, callback?: Auth0Callback<SsoDataResult | undefined>): void;
|
70 |
|
71 | |
72 |
|
73 |
|
74 |
|
75 | userInfo(accessToken: string, callback: Auth0Callback<Auth0UserProfile>): void;
|
76 |
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 | delegation(options: DelegationOptions, callback: Auth0Callback<Auth0DelegationToken>): any;
|
83 |
|
84 | |
85 |
|
86 |
|
87 |
|
88 | getUserCountry(callback: Auth0Callback<{ countryCode: string }>): void;
|
89 | }
|
90 |
|
91 | export class PasswordlessAuthentication {
|
92 | constructor(request: any, option: any);
|
93 |
|
94 | /**
|
95 | * Builds and returns the passwordless TOTP verify url in order to initialize a new authN/authZ transaction
|
96 | *
|
97 | */
|
98 | buildVerifyUrl(options: PasswordlessVerifyOptions): string;
|
99 |
|
100 | /**
|
101 | * Initializes a new passwordless authN/authZ transaction
|
102 | *
|
103 | * @param options: https://auth0.com/docs/api/authentication#passwordless
|
104 | */
|
105 | start(options: PasswordlessStartOptions, callback: Auth0Callback<any>): void;
|
106 |
|
107 | /**
|
108 | * Verifies the passwordless TOTP and returns an error if any.
|
109 | *
|
110 | */
|
111 | verify(options: PasswordlessVerifyOptions, callback: Auth0Callback<any>): void;
|
112 | }
|
113 |
|
114 | export class DBConnection {
|
115 | constructor(request: any, option: any);
|
116 |
|
117 | /**
|
118 | * Creates a new user in a Auth0 Database connection
|
119 | * @param options https://auth0.com/docs/api/authentication#signup
|
120 | */
|
121 | signup(options: DbSignUpOptions, callback: Auth0Callback<DbSignUpResults>): void;
|
122 |
|
123 | /**
|
124 | * Initializes the change password flow
|
125 | *
|
126 | * @param options: https://auth0.com/docs/api/authentication#!#post--dbconnections-change_password
|
127 | */
|
128 | changePassword(options: ChangePasswordOptions, callback: Auth0Callback<any>): void;
|
129 | }
|
130 |
|
131 | export class Management {
|
132 | |
133 |
|
134 |
|
135 | constructor(options: ManagementOptions);
|
136 |
|
137 | /**
|
138 | * Returns the user profile. https://auth0.com/docs/api/management/v2#!/Users/get_users_by_id
|
139 | *
|
140 | */
|
141 | getUser(userId: string, callback: Auth0Callback<Auth0UserProfile>): void;
|
142 |
|
143 | /**
|
144 | * Updates the user metadata. It will patch the user metadata with the attributes sent.
|
145 | * https://auth0.com/docs/api/management/v2#!/Users/patch_users_by_id
|
146 | *
|
147 | */
|
148 | patchUserMetadata(userId: string, userMetadata: any, callback: Auth0Callback<Auth0UserProfile>): void;
|
149 | /**
|
150 | * Updates the user attributes.
|
151 | * It will patch the root attributes that the server allows it.
|
152 | * {@link https:
|
153 | */
|
154 | patchUserAttributes(userId: string, user: Auth0UserProfile, callback: Auth0Callback<Auth0UserProfile>): void;
|
155 | |
156 |
|
157 |
|
158 |
|
159 | linkUser(userId: string, secondaryUserToken: string, callback: Auth0Callback<any>): void;
|
160 | }
|
161 |
|
162 | export class WebAuth {
|
163 | constructor(options: AuthOptions);
|
164 | client: Authentication;
|
165 | popup: Popup;
|
166 | redirect: Redirect;
|
167 | crossOriginAuthentication: CrossOriginAuthentication;
|
168 |
|
169 | /**
|
170 | * Redirects to the hosted login page (`/authorize`) in order to initialize a new authN/authZ transaction
|
171 | *
|
172 | * @param options: https://auth0.com/docs/api/authentication#!#get--authorize_db
|
173 | */
|
174 | authorize(options?: AuthorizeOptions): void;
|
175 |
|
176 | /**
|
177 | * Parse the url hash and extract the returned tokens depending on the transaction.
|
178 | *
|
179 | * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed
|
180 | * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be
|
181 | * accepted.
|
182 | *
|
183 | * @param callback: any(err, token_payload)
|
184 | */
|
185 | parseHash(callback: Auth0Callback<Auth0DecodedHash | null, Auth0ParseHashError>): void;
|
186 |
|
187 | /**
|
188 | * Parse the url hash and extract the returned tokens depending on the transaction.
|
189 | *
|
190 | * Only validates id_tokens signed by Auth0 using the RS256 algorithm using the public key exposed
|
191 | * by the `/.well-known/jwks.json` endpoint. Id tokens signed with other algorithms will not be
|
192 | * accepted.
|
193 | *
|
194 | * @param callback: any(err, token_payload)
|
195 | */
|
196 | parseHash(options: ParseHashOptions, callback: Auth0Callback<Auth0DecodedHash | null, Auth0ParseHashError>): void;
|
197 |
|
198 | /**
|
199 | * Decodes the id_token and verifies the nonce.
|
200 | *
|
201 | * @param callback: function(err, {payload, transaction})
|
202 | */
|
203 | validateToken(token: string, nonce: string, callback: Auth0Callback<any>): void;
|
204 |
|
205 | /**
|
206 | * Executes a silent authentication transaction under the hood in order to fetch a new tokens for the current session.
|
207 | * This method requires that all Auth is performed with {@link authorize}
|
208 | * Watch out! If you're not using the hosted login page to do social logins, you have to use your own [social connection keys](https://manage.auth0.com/#/connections/social).
|
209 | * If you use Auth0's dev keys, you'll always get `login_required` as an error when calling this method.
|
210 | *
|
211 | * @param options: any valid oauth2 parameter to be sent to the `/authorize` endpoint
|
212 | */
|
213 | renewAuth(options: RenewAuthOptions, callback: Auth0Callback<any>): void;
|
214 |
|
215 | |
216 |
|
217 |
|
218 |
|
219 |
|
220 | changePassword(options: ChangePasswordOptions, callback: Auth0Callback<any>): void;
|
221 |
|
222 | |
223 |
|
224 |
|
225 |
|
226 |
|
227 | signup(options: DbSignUpOptions, callback: Auth0Callback<any>): void;
|
228 |
|
229 | |
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 | signupAndAuthorize(options: DbSignUpOptions, callback: Auth0Callback<any>): void;
|
236 |
|
237 | |
238 |
|
239 |
|
240 |
|
241 |
|
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 | login(options: CrossOriginLoginOptions, callback: Auth0Callback<any>): void;
|
249 |
|
250 | |
251 |
|
252 |
|
253 |
|
254 |
|
255 | crossOriginAuthenticationCallback(): void;
|
256 |
|
257 | |
258 |
|
259 |
|
260 |
|
261 | crossOriginVerification(): void;
|
262 |
|
263 | |
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 | logout(options: LogoutOptions): void;
|
274 |
|
275 | |
276 |
|
277 |
|
278 |
|
279 |
|
280 | passwordlessStart(options: PasswordlessStartOptions, callback: Auth0Callback<any>): void;
|
281 |
|
282 | |
283 |
|
284 |
|
285 |
|
286 |
|
287 | passwordlessVerify(options: PasswordlessVerifyOptions, callback: Auth0Callback<any>): void;
|
288 |
|
289 | |
290 |
|
291 |
|
292 |
|
293 |
|
294 | passwordlessLogin(options: PasswordlessLoginOptions, callback: Auth0Callback<any>): void;
|
295 |
|
296 | |
297 |
|
298 |
|
299 |
|
300 |
|
301 |
|
302 |
|
303 | checkSession(options: CheckSessionOptions, cb: Auth0Callback<any>): void;
|
304 |
|
305 | |
306 |
|
307 |
|
308 |
|
309 |
|
310 |
|
311 |
|
312 |
|
313 |
|
314 | renderCaptcha(element: HTMLElement, options?: CatpchaConfiguration, callback?: Auth0Callback<any>): Captcha;
|
315 | }
|
316 |
|
317 | export class Redirect {
|
318 | constructor(client: any, options: any);
|
319 |
|
320 | /**
|
321 | * Performs authentication with username/email and password with a database connection
|
322 | *
|
323 | * This method is not compatible with API Auth so if you need to fetch API tokens with audience
|
324 | * you should use {@link authorize} or {@link login}.
|
325 | */
|
326 | loginWithCredentials(
|
327 | options: {
|
328 |
|
329 | redirectUri?: string | undefined;
|
330 |
|
331 | responseType?: string | undefined;
|
332 |
|
333 | responseMode?: "query" | "fragment" | undefined;
|
334 |
|
335 | scope: string;
|
336 | },
|
337 | callback: Auth0Callback<any>,
|
338 | ): void;
|
339 |
|
340 | |
341 |
|
342 |
|
343 | signupAndLogin(
|
344 | options: {
|
345 |
|
346 | email: string;
|
347 |
|
348 | password: string;
|
349 |
|
350 | connection: string;
|
351 |
|
352 | userMetadata?: unknown | undefined;
|
353 | } & CrossOriginLoginOptions,
|
354 | callback: Auth0Callback<any>,
|
355 | ): void;
|
356 | }
|
357 |
|
358 | export class Popup {
|
359 | constructor(client: any, options: any);
|
360 |
|
361 | /**
|
362 | * Returns a new instance of the popup handler
|
363 | */
|
364 | private buildPopupHandler(): any;
|
365 |
|
366 | /**
|
367 | * Initializes the popup window and returns the instance to be used later in order to avoid being blocked by the browser.
|
368 | *
|
369 | * @param options: receives the window height and width and any other window feature to be sent to window.open
|
370 | */
|
371 | preload(options: any): any;
|
372 |
|
373 | /**
|
374 | * Handles the popup logic for the callback page.
|
375 | * @see {@link parseHash}
|
376 | */
|
377 | callback(options: {
|
378 | |
379 |
|
380 |
|
381 |
|
382 | hash: string;
|
383 |
|
384 | state?: string | undefined;
|
385 |
|
386 | nonce?: string | undefined;
|
387 | |
388 |
|
389 |
|
390 |
|
391 | _idTokenVerification?: string | undefined;
|
392 | }): void;
|
393 |
|
394 | |
395 |
|
396 |
|
397 |
|
398 | authorize(
|
399 | options: {
|
400 |
|
401 | domain: string;
|
402 |
|
403 | clientId?: string | undefined;
|
404 | |
405 |
|
406 |
|
407 |
|
408 |
|
409 | connection?: string | undefined;
|
410 |
|
411 | redirectUri: string;
|
412 | |
413 |
|
414 |
|
415 |
|
416 |
|
417 | responseType: string;
|
418 | |
419 |
|
420 |
|
421 |
|
422 | responseMode?: "query" | "fragment" | "form_post" | undefined;
|
423 | |
424 |
|
425 |
|
426 |
|
427 | state?: string | undefined;
|
428 | |
429 |
|
430 |
|
431 |
|
432 | nonce?: string | undefined;
|
433 |
|
434 | scope?: string | undefined;
|
435 |
|
436 | audience?: string | undefined;
|
437 |
|
438 | owp?: boolean | undefined;
|
439 | },
|
440 | callback: Auth0Callback<Auth0Result>,
|
441 | ): void;
|
442 |
|
443 | |
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 | loginWithCredentials(
|
450 | options: {
|
451 |
|
452 | redirectUri?: string | undefined;
|
453 |
|
454 | responseType?: "code" | "token" | undefined;
|
455 |
|
456 | responseMode?: "query" | "fragment" | undefined;
|
457 |
|
458 | scope?: string | undefined;
|
459 | },
|
460 | callback: Auth0Callback<any>,
|
461 | ): void;
|
462 |
|
463 | |
464 |
|
465 |
|
466 | passwordlessVerify(
|
467 | options: {
|
468 | type: "sms" | "email";
|
469 |
|
470 | phoneNumber?: string | undefined;
|
471 |
|
472 | email?: string | undefined;
|
473 |
|
474 | connection: string;
|
475 |
|
476 | verificationCode: string;
|
477 | },
|
478 | callback: Auth0Callback<any>,
|
479 | ): void;
|
480 |
|
481 | |
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 | signupAndLogin(
|
488 | options: {
|
489 |
|
490 | email: string;
|
491 |
|
492 | password: string;
|
493 |
|
494 | connection: string;
|
495 |
|
496 | userMetadata?: unknown | undefined;
|
497 | },
|
498 | callback: Auth0Callback<any>,
|
499 | ): void;
|
500 | }
|
501 |
|
502 | export class CrossOriginAuthentication {
|
503 | constructor(webAuth: any, options: any);
|
504 |
|
505 | /**
|
506 | * Logs in the user with username and password using the cross origin authentication (/co/authenticate) flow.
|
507 | * You can use either `username` or `email` to identify the user, but `username` will take precedence over `email`.
|
508 | * This only works when 3rd party cookies are enabled in the browser.
|
509 | * After the /co/authenticate call, you'll have to use the {@link parseHash} function at the `redirectUri` specified in the constructor.
|
510 | *
|
511 | * @param options options used in the {@link authorize} call after the login_ticket is acquired
|
512 | * @param cb Callback function called only when an authentication error, like invalid username or password, occurs.
|
513 | * For other types of errors, there will be a redirect to the `redirectUri`.
|
514 | */
|
515 | login(options: CrossOriginLoginOptions, callback: Auth0Callback<any>): void;
|
516 |
|
517 | |
518 |
|
519 |
|
520 |
|
521 | callback(): void;
|
522 | }
|
523 |
|
524 | export type Auth0Callback<T, E = Auth0Error> = (error: null | E, result: T) => void;
|
525 |
|
526 | export interface TokenProvider {
|
527 | enableCache?: boolean | undefined;
|
528 | cacheTTLInSeconds?: number | undefined;
|
529 | }
|
530 |
|
531 | export interface ManagementOptions {
|
532 | domain: string;
|
533 | token?: string | undefined;
|
534 | clientId?: string | undefined;
|
535 | clientSecret?: string | undefined;
|
536 | audience?: string | undefined;
|
537 | scope?: string | undefined;
|
538 | tokenProvider?: TokenProvider | undefined;
|
539 | telemetry?: boolean | undefined;
|
540 | }
|
541 |
|
542 | export interface AuthOptions {
|
543 | domain: string;
|
544 | clientID: string;
|
545 | responseType?: string | undefined;
|
546 | responseMode?: string | undefined;
|
547 | redirectUri?: string | undefined;
|
548 | scope?: string | undefined;
|
549 | audience?: string | undefined;
|
550 | |
551 |
|
552 |
|
553 |
|
554 | maxAge?: number | undefined;
|
555 | leeway?: number | undefined;
|
556 | jwksURI?: string | undefined;
|
557 | overrides?: {
|
558 | __tenant?: string | undefined;
|
559 | __token_issuer?: string | undefined;
|
560 | __jwks_uri?: string | undefined;
|
561 | } | undefined;
|
562 | plugins?: any;
|
563 | popupOrigin?: string | undefined;
|
564 | protocol?: string | undefined;
|
565 | response_type?: string | undefined;
|
566 | state?: string | undefined;
|
567 | tenant?: string | undefined;
|
568 | universalLoginPage?: boolean | undefined;
|
569 | _csrf?: string | undefined;
|
570 | _intstate?: string | undefined;
|
571 | _timesToRetryFailedRequests?: number | undefined;
|
572 | _disableDeprecationWarnings?: boolean | undefined;
|
573 | _sendTelemetry?: boolean | undefined;
|
574 | _telemetryInfo?: any;
|
575 | __tryLocalStorageFirst?: boolean | undefined;
|
576 | }
|
577 |
|
578 | export type DoneCallback = (err?: Auth0Error) => void;
|
579 |
|
580 | export interface Captcha {
|
581 | reload: (done: DoneCallback) => void;
|
582 | getValue: () => string;
|
583 | }
|
584 |
|
585 | export interface CatpchaConfiguration {
|
586 | |
587 |
|
588 |
|
589 | templates?: CaptchaTemplates | undefined;
|
590 |
|
591 | |
592 |
|
593 |
|
594 |
|
595 | lang?: string | undefined;
|
596 | }
|
597 |
|
598 |
|
599 |
|
600 |
|
601 | export interface CaptchaTemplates {
|
602 | |
603 |
|
604 |
|
605 | auth0?: ((challenge: Auth0Challenge) => string) | undefined;
|
606 |
|
607 | /**
|
608 | * Template function receiving the challenge and returning an string
|
609 | */
|
610 | recaptcha_v2?: ((challenge: Auth0Challenge) => string) | undefined;
|
611 |
|
612 | error: (error: Error) => string;
|
613 | }
|
614 |
|
615 | export interface Auth0Challenge {
|
616 | type: "code";
|
617 | image: string;
|
618 | required: boolean;
|
619 | provider: "auth0" | "recaptcha_v2";
|
620 | [other: string]: unknown;
|
621 | }
|
622 |
|
623 | export interface PasswordlessAuthOptions {
|
624 | connection: string;
|
625 | verificationCode: string;
|
626 | phoneNumber: string;
|
627 | email: string;
|
628 | }
|
629 |
|
630 |
|
631 |
|
632 |
|
633 | export type LibErrorCodes = "timeout" | "request_error" | "invalid_token";
|
634 |
|
635 |
|
636 |
|
637 |
|
638 | export type LoginRequiredErrorCode = "login_required";
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 | export type InteractionRequiredErrorCode = "interaction_required";
|
646 |
|
647 |
|
648 |
|
649 |
|
650 | export type ConsentRequiredErrorCode = "consent_required";
|
651 |
|
652 |
|
653 |
|
654 |
|
655 | export type SpecErrorCodes =
|
656 | | LoginRequiredErrorCode
|
657 | | InteractionRequiredErrorCode
|
658 | | ConsentRequiredErrorCode
|
659 | | "account_selection_required"
|
660 | | "invalid_request_uri"
|
661 | | "invalid_request_object"
|
662 | | "request_not_supported"
|
663 | | "request_uri_not_supported"
|
664 | | "registration_not_supported";
|
665 |
|
666 | export interface Auth0Error {
|
667 | error: LibErrorCodes | SpecErrorCodes | string;
|
668 | errorDescription?: string | undefined;
|
669 |
|
670 | error_description?: string | undefined;
|
671 |
|
672 | code?: string | undefined;
|
673 | description?: string | undefined;
|
674 | name?: string | undefined;
|
675 | policy?: string | undefined;
|
676 | original?: any;
|
677 | statusCode?: number | undefined;
|
678 | statusText?: string | undefined;
|
679 | }
|
680 |
|
681 |
|
682 |
|
683 |
|
684 |
|
685 | export interface Auth0Result {
|
686 | |
687 |
|
688 |
|
689 |
|
690 | accessToken?: string | undefined;
|
691 |
|
692 | expiresIn?: number | undefined;
|
693 |
|
694 | idToken?: string | undefined;
|
695 | |
696 |
|
697 |
|
698 |
|
699 |
|
700 | refreshToken?: string | undefined;
|
701 |
|
702 | appState?: any;
|
703 | }
|
704 |
|
705 | export type Auth0ParseHashError = Auth0Error & {
|
706 | state?: string | undefined;
|
707 | };
|
708 |
|
709 |
|
710 |
|
711 |
|
712 | export interface Auth0DecodedHash {
|
713 | accessToken?: string | undefined;
|
714 | idToken?: string | undefined;
|
715 | idTokenPayload?: any;
|
716 | appState?: any;
|
717 | refreshToken?: string | undefined;
|
718 | state?: string | undefined;
|
719 | expiresIn?: number | undefined;
|
720 | tokenType?: string | undefined;
|
721 | scope?: string | undefined;
|
722 | }
|
723 |
|
724 |
|
725 | export interface Auth0DelegationToken {
|
726 |
|
727 | expiresIn: number;
|
728 |
|
729 | idToken: string;
|
730 |
|
731 | tokenType: string;
|
732 | }
|
733 |
|
734 | export interface ChangePasswordOptions {
|
735 | connection: string;
|
736 | email: string;
|
737 | }
|
738 |
|
739 | export interface BaseAuthOptions {
|
740 | clientID?: string | undefined;
|
741 | responseType?: string | undefined;
|
742 | redirectUri?: string | undefined;
|
743 | scope?: string | undefined;
|
744 | audience?: string | undefined;
|
745 | state?: string | undefined;
|
746 | nonce?: string | undefined;
|
747 | _csrf?: string | undefined;
|
748 | __instate?: string | undefined;
|
749 | }
|
750 |
|
751 | export interface PasswordlessStartAuthParams extends BaseAuthOptions {
|
752 | responseMode?: string | undefined;
|
753 | }
|
754 |
|
755 | export interface PasswordlessStartOptions {
|
756 | connection: string;
|
757 | send: string;
|
758 | phoneNumber?: string | undefined;
|
759 | email?: string | undefined;
|
760 | authParams?: PasswordlessStartAuthParams | undefined;
|
761 | }
|
762 |
|
763 | export interface PasswordlessVerifyOptions extends BaseAuthOptions {
|
764 | connection: string;
|
765 | verificationCode: string;
|
766 | phoneNumber?: string | undefined;
|
767 | email?: string | undefined;
|
768 | send?: string | undefined;
|
769 | responseMode?: string | undefined;
|
770 | }
|
771 |
|
772 | export interface PasswordlessLoginOptions extends BaseAuthOptions {
|
773 | connection: string;
|
774 | verificationCode: string;
|
775 | phoneNumber?: string | undefined;
|
776 | email?: string | undefined;
|
777 | }
|
778 |
|
779 | export interface Auth0UserProfile {
|
780 | name: string;
|
781 | nickname: string;
|
782 | picture: string;
|
783 | user_id: string;
|
784 | username?: string | undefined;
|
785 | given_name?: string | undefined;
|
786 | family_name?: string | undefined;
|
787 | email?: string | undefined;
|
788 | email_verified?: boolean | undefined;
|
789 | clientID: string;
|
790 | gender?: string | undefined;
|
791 | locale?: string | undefined;
|
792 | identities: Auth0Identity[];
|
793 | created_at: string;
|
794 | updated_at: string;
|
795 | sub: string;
|
796 | user_metadata?: any;
|
797 | app_metadata?: any;
|
798 | }
|
799 |
|
800 | export interface MicrosoftUserProfile extends Auth0UserProfile {
|
801 | emails?: string[] | undefined;
|
802 | }
|
803 |
|
804 | export interface Office365UserProfile extends Auth0UserProfile {
|
805 | tenantid: string;
|
806 | upn: string;
|
807 | }
|
808 |
|
809 | export interface AdfsUserProfile extends Auth0UserProfile {
|
810 | issuer?: string | undefined;
|
811 | }
|
812 |
|
813 | export interface AuthorizeUrlOptions {
|
814 | |
815 |
|
816 |
|
817 | clientID?: string | undefined;
|
818 | |
819 |
|
820 |
|
821 | redirectUri: string;
|
822 | |
823 |
|
824 |
|
825 |
|
826 |
|
827 | responseType: string;
|
828 | |
829 |
|
830 |
|
831 |
|
832 |
|
833 | responseMode?: "query" | "fragment" | "form_post" | undefined;
|
834 | |
835 |
|
836 |
|
837 |
|
838 | state?: string | undefined;
|
839 | |
840 |
|
841 |
|
842 |
|
843 | nonce?: string | undefined;
|
844 | |
845 |
|
846 |
|
847 | scope?: string | undefined;
|
848 | |
849 |
|
850 |
|
851 | audience?: string | undefined;
|
852 | }
|
853 |
|
854 | export interface Auth0Identity {
|
855 | connection: string;
|
856 | isSocial: boolean;
|
857 | provider: string;
|
858 | user_id: string;
|
859 | }
|
860 |
|
861 | export interface LoginOptions {
|
862 | username: string;
|
863 | password: string;
|
864 | scope?: string | undefined;
|
865 | }
|
866 |
|
867 | export interface DefaultLoginOptions extends LoginOptions {
|
868 | audience?: string | undefined;
|
869 | realm: string;
|
870 | }
|
871 |
|
872 | export interface DefaultDirectoryLoginOptions extends LoginOptions {
|
873 | audience?: string | undefined;
|
874 | }
|
875 |
|
876 | export interface ResourceOwnerLoginOptions extends LoginOptions {
|
877 | connection: string;
|
878 | device?: string | undefined;
|
879 | }
|
880 |
|
881 | export interface CrossOriginLoginOptions {
|
882 | username?: string | undefined;
|
883 | email?: string | undefined;
|
884 | password: string;
|
885 | realm?: string | undefined;
|
886 | domain?: string | undefined;
|
887 | clientID?: string | undefined;
|
888 | redirectUri?: string | undefined;
|
889 | responseType?: string | undefined;
|
890 | responseMode?: string | undefined;
|
891 | state?: string | undefined;
|
892 | nonce?: string | undefined;
|
893 | scope?: string | undefined;
|
894 | audience?: string | undefined;
|
895 | onRedirecting?: (done: () => void) => void | undefined;
|
896 | }
|
897 |
|
898 | export interface LogoutOptions {
|
899 | clientID?: string | undefined;
|
900 | returnTo?: string | undefined;
|
901 | federated?: boolean | undefined;
|
902 | }
|
903 |
|
904 | export interface DelegationOptions {
|
905 | client_id?: string | undefined;
|
906 | grant_type: string;
|
907 | id_token?: string | undefined;
|
908 | refresh_token?: string | undefined;
|
909 | target?: string | undefined;
|
910 | scope?: string | undefined;
|
911 | api_type?: string | undefined;
|
912 | }
|
913 |
|
914 | export interface DbSignUpOptions {
|
915 |
|
916 | email: string;
|
917 |
|
918 | password: string;
|
919 |
|
920 | connection: string;
|
921 |
|
922 | username?: string | undefined;
|
923 | scope?: string | undefined;
|
924 |
|
925 | userMetadata?: unknown | undefined;
|
926 | }
|
927 |
|
928 |
|
929 | export interface DbSignUpResults {
|
930 |
|
931 | email: string;
|
932 |
|
933 | emailVerified: boolean;
|
934 | }
|
935 |
|
936 | export interface ParseHashOptions {
|
937 | hash?: string | undefined;
|
938 | state?: string | undefined;
|
939 | nonce?: string | undefined;
|
940 | _idTokenVerification?: boolean | undefined;
|
941 |
|
942 | __enableIdPInitiatedLogin?: boolean | undefined;
|
943 | }
|
944 |
|
945 | export interface RenewAuthOptions {
|
946 | |
947 |
|
948 |
|
949 | domain?: string | undefined;
|
950 | |
951 |
|
952 |
|
953 | clientID?: string | undefined;
|
954 | |
955 |
|
956 |
|
957 | redirectUri?: string | undefined;
|
958 | |
959 |
|
960 |
|
961 |
|
962 |
|
963 | responseType?: string | undefined;
|
964 | |
965 |
|
966 |
|
967 |
|
968 |
|
969 |
|
970 | responseMode?: string | undefined;
|
971 | |
972 |
|
973 |
|
974 |
|
975 | state?: string | undefined;
|
976 | |
977 |
|
978 |
|
979 |
|
980 | nonce?: string | undefined;
|
981 | |
982 |
|
983 |
|
984 | scope?: string | undefined;
|
985 | |
986 |
|
987 |
|
988 | audience?: string | undefined;
|
989 | |
990 |
|
991 |
|
992 |
|
993 |
|
994 | postMessageDataType?: string | undefined;
|
995 | |
996 |
|
997 |
|
998 |
|
999 | postMessageOrigin?: string | undefined;
|
1000 | |
1001 |
|
1002 |
|
1003 |
|
1004 | timeout?: number | undefined;
|
1005 | |
1006 |
|
1007 |
|
1008 |
|
1009 |
|
1010 |
|
1011 | usePostMessage?: boolean | undefined;
|
1012 | }
|
1013 |
|
1014 | export interface AuthorizeOptions {
|
1015 | domain?: string | undefined;
|
1016 | clientID?: string | undefined;
|
1017 | connection?: string | undefined;
|
1018 | redirectUri?: string | undefined;
|
1019 | responseType?: string | undefined;
|
1020 | responseMode?: string | undefined;
|
1021 | state?: string | undefined;
|
1022 | nonce?: string | undefined;
|
1023 | scope?: string | undefined;
|
1024 | audience?: string | undefined;
|
1025 | language?: string | undefined;
|
1026 | login_hint?: string | undefined;
|
1027 | prompt?: string | undefined;
|
1028 | mode?: "login" | "signUp" | undefined;
|
1029 | screen_hint?: "signup" | undefined;
|
1030 | accessType?: string | undefined;
|
1031 | approvalPrompt?: string | undefined;
|
1032 | appState?: any;
|
1033 | connection_scope?: string | string[] | undefined;
|
1034 | }
|
1035 |
|
1036 | export type SsoDataResult = SsoSessionFoundResult | SsoSessionNotFoundResult;
|
1037 |
|
1038 | export interface SsoSessionFoundResult {
|
1039 | lastUsedClientID: string;
|
1040 | lastUsedConnection: {
|
1041 | name: string;
|
1042 | strategy?: string | undefined;
|
1043 | };
|
1044 | lastUsedUserID: string;
|
1045 | lastUsedUsername: string;
|
1046 | sessionClients: string[];
|
1047 | sso: true;
|
1048 | }
|
1049 |
|
1050 | export interface SsoSessionNotFoundResult {
|
1051 | sso: false;
|
1052 | }
|
1053 |
|
1054 | export interface CheckSessionOptions extends AuthorizeOptions {
|
1055 | |
1056 |
|
1057 |
|
1058 | usePostMessage?: boolean | undefined;
|
1059 | }
|
1060 |
|
1061 | export const version: {
|
1062 | raw: string;
|
1063 | };
|