feat: access token generic para permitir customização
This commit is contained in:
parent
4b61c118ad
commit
477d9fc6a7
3 changed files with 46 additions and 52 deletions
|
@ -1,45 +1,44 @@
|
|||
import { AxiosRequestConfig } from "axios";
|
||||
|
||||
export interface Headers {
|
||||
[name: string]: any;
|
||||
[name: string]: any;
|
||||
}
|
||||
|
||||
export interface LhispOauthClientConstructorParams {
|
||||
authUrl: string;
|
||||
apiUrl: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
certificado?: string;
|
||||
senhaCertificado?: string;
|
||||
authScope?: string;
|
||||
authHeaderName?: string;
|
||||
tokenHeaderName?: string;
|
||||
headers?: Headers;
|
||||
grantType?: string;
|
||||
authContentType?: ContentType;
|
||||
sendAuthCredentialsOnRequestBody?: boolean;
|
||||
debug?: boolean;
|
||||
authUrl: string;
|
||||
apiUrl: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
certificado?: string;
|
||||
senhaCertificado?: string;
|
||||
authScope?: string;
|
||||
authHeaderName?: string;
|
||||
tokenHeaderName?: string;
|
||||
headers?: Headers;
|
||||
grantType?: string;
|
||||
authContentType?: ContentType;
|
||||
sendAuthCredentialsOnRequestBody?: boolean;
|
||||
debug?: boolean;
|
||||
}
|
||||
|
||||
export interface ExecutarRequestParams extends AxiosRequestConfig {
|
||||
path: string;
|
||||
contentType?: ContentType,
|
||||
path: string;
|
||||
contentType?: ContentType;
|
||||
}
|
||||
|
||||
export interface AccessToken {
|
||||
token_type: string;
|
||||
access_token: string;
|
||||
expires_in: number;
|
||||
scope?: string;
|
||||
created_at?: number;
|
||||
token_type: string;
|
||||
access_token: string;
|
||||
expires_in: number;
|
||||
scope?: string;
|
||||
}
|
||||
|
||||
export enum ContentType {
|
||||
APPLICATION_JSON='application/json',
|
||||
APPLICATION_X_WWW_FORM_URLENCODED='application/x-www-form-urlencoded',
|
||||
APPLICATION_JSON = "application/json",
|
||||
APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded",
|
||||
}
|
||||
|
||||
export const defaultGrantType = 'client_credentials';
|
||||
export const defaultGrantType = "client_credentials";
|
||||
export const defaultAuthContentType = ContentType.APPLICATION_X_WWW_FORM_URLENCODED;
|
||||
export const defaultAuthHeaderName = 'Authorization';
|
||||
export const defaultTokenHeaderName = 'Authorization';
|
||||
export const defaultAuthHeaderName = "Authorization";
|
||||
export const defaultTokenHeaderName = "Authorization";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue