UNPKG

1.64 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright Akveo. All Rights Reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 */
6import { NbAuthTokenClass } from '../../services/token/token';
7import { NbAuthStrategyOptions } from '../auth-strategy-options';
8export declare enum NbOAuth2ResponseType {
9 CODE = "code",
10 TOKEN = "token"
11}
12export declare enum NbOAuth2GrantType {
13 AUTHORIZATION_CODE = "authorization_code",
14 PASSWORD = "password",
15 REFRESH_TOKEN = "refresh_token"
16}
17export declare enum NbOAuth2ClientAuthMethod {
18 NONE = "none",
19 BASIC = "basic",
20 REQUEST_BODY = "request-body"
21}
22export declare class NbOAuth2AuthStrategyOptions extends NbAuthStrategyOptions {
23 baseEndpoint?: string;
24 clientId: string;
25 clientSecret?: string;
26 clientAuthMethod?: string;
27 redirect?: {
28 success?: string;
29 failure?: string;
30 };
31 defaultErrors?: any[];
32 defaultMessages?: any[];
33 authorize?: {
34 endpoint?: string;
35 redirectUri?: string;
36 responseType?: string;
37 requireValidToken?: boolean;
38 scope?: string;
39 state?: string;
40 params?: {
41 [key: string]: string;
42 };
43 };
44 token?: {
45 endpoint?: string;
46 grantType?: string;
47 redirectUri?: string;
48 scope?: string;
49 requireValidToken?: boolean;
50 class: NbAuthTokenClass;
51 };
52 refresh?: {
53 endpoint?: string;
54 grantType?: string;
55 scope?: string;
56 requireValidToken?: boolean;
57 };
58}
59export declare const auth2StrategyOptions: NbOAuth2AuthStrategyOptions;