UNPKG

1.84 kBTypeScriptView Raw
1export declare type OAuthServiceConfiguration = {
2 revocationEndpoint?: string;
3 authorizationEndpoint?: string;
4 registrationEndpoint?: string;
5 tokenEndpoint: string;
6};
7export declare type OAuthDisplayParameter = 'page' | 'popup' | 'touch' | 'wap';
8export declare type OAuthPromptParameter = 'none' | 'login' | 'consent' | 'select_account';
9export declare type OAuthNonceParameter = string;
10export declare type OAuthUILocalesParameter = string;
11export declare type OAuthIDTokenHintParameter = string;
12export declare type OAuthMaxAgeParameter = string;
13export declare type OAuthLoginHintParameter = string;
14export declare type OAuthACRValuesParameter = string;
15export declare type OAuthParameters = {
16 nonce?: OAuthNonceParameter;
17 display?: OAuthDisplayParameter;
18 prompt?: OAuthPromptParameter;
19 max_age?: OAuthMaxAgeParameter;
20 ui_locales?: OAuthUILocalesParameter;
21 id_token_hint?: OAuthIDTokenHintParameter;
22 login_hint?: OAuthLoginHintParameter;
23 acr_values?: OAuthACRValuesParameter;
24 [key: string]: any;
25};
26export declare type OAuthBaseProps = {
27 clientId: string;
28 issuer: string;
29 serviceConfiguration?: OAuthServiceConfiguration;
30};
31export declare type OAuthProps = OAuthBaseProps & {
32 redirectUrl?: string;
33 clientSecret?: string;
34 scopes?: Array<string>;
35 additionalParameters?: OAuthParameters;
36 canMakeInsecureRequests?: boolean;
37 isRefresh?: boolean;
38 refreshToken?: string;
39};
40export declare type OAuthRevokeOptions = {
41 token: string;
42 isClientIdProvided?: boolean;
43};
44export declare type TokenResponse = {
45 accessToken: string | null;
46 accessTokenExpirationDate: string | null;
47 additionalParameters: {
48 [key: string]: any;
49 } | null;
50 idToken: string | null;
51 tokenType: string | null;
52 refreshToken: string | null;
53};