Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
▪ T
InMemoryAuthStorage
AuthStorage‹T›
▸ getData(): T | undefined
Implementation of AuthStorage
Defined in packages/auth-interceptor/src/storage/inMemory.authStorage.ts:6
Returns: T | undefined
▸ setData(data
: T): void
Implementation of AuthStorage
Defined in packages/auth-interceptor/src/storage/inMemory.authStorage.ts:10
Parameters:
Returns: void
OAuth2InterceptorOptions
• authStorage: AuthStorage‹OAuth2TokenResponse›
Defined in packages/auth-interceptor/src/oauth2Interceptor.types.ts:49
Data storage for OAuth credentials. Uses InMemoryAuthStorage by default. One can implement their own storage, i.e. backed by Redux or LocalStorage.
• canAuthorize: function
Defined in packages/auth-interceptor/src/oauth2Interceptor.types.ts:62
Determine if request should be processed, by checking request's options (i.e. check for a domain match)
param
Request options
▸ (options
: NormalizedHttpOptions): boolean
Parameters:
• oauth: object
Defined in packages/auth-interceptor/src/oauth2Interceptor.types.ts:17
clientId: string
clientSecret? : undefined | string
contentType? : ContentType
httpClientOptions: HttpClientConfig
refreshTokenUrl: string
• onAuthorizationFailure: function
Defined in packages/auth-interceptor/src/oauth2Interceptor.types.ts:56
This function is called when:
authorize() function throws an error,
a second call to an api endpoint results in 401.
▸ (err
: AuthError): Promisable
Parameters:
↳ AuthError
+ new AuthError(message
: string, cause?
: Error): AuthError
Defined in packages/auth-interceptor/src/authError.ts:2
Parameters:
Returns: AuthError
Optional
cause• cause? : Error
Defined in packages/auth-interceptor/src/authError.ts:2
• message: string
Inherited from AuthError.message
Defined in node_modules/typescript/lib/lib.es5.d.ts:974
• name: string
Defined in node_modules/typescript/lib/lib.es5.d.ts:973
Optional
stack• stack? : undefined | string
Inherited from AuthError.stack
Defined in node_modules/typescript/lib/lib.es5.d.ts:975
Static
Error▪ Error: ErrorConstructor
Defined in node_modules/typescript/lib/lib.es5.d.ts:984
AuthInterceptorOptions
• canAuthorize: function
Defined in packages/auth-interceptor/src/authInterceptor.types.ts:30
Determine if request should be processed, by checking request's options (i.e. check for a domain match)
param
Request options
▸ (options
: NormalizedHttpOptions): boolean
Parameters:
• onAuthorizationFailure: function
Defined in packages/auth-interceptor/src/authInterceptor.types.ts:24
This function is called when:
authorize() function throws an error,
a second call to an api endpoint results in 401.
▸ (err
: AuthError): Promisable
Parameters:
• reauthorize: function
Defined in packages/auth-interceptor/src/authInterceptor.types.ts:10
Obtain authorization data. At this point previous token has expired or Unauthorized response status code has been received. You can call refresh token endpoint.
▸ (): Promisable
• setAuthorizationData: function
Defined in packages/auth-interceptor/src/authInterceptor.types.ts:17
Insert authorization data to the request.
param
Authorization data obtained earlier by {#authorize}
param
Request options
▸ (options
: NormalizedHttpOptions): Promisable
Parameters:
AuthInterceptor
HttpInterceptorInterface
+ new AuthInterceptor(options
: AuthInterceptorOptions): AuthInterceptor
Defined in packages/auth-interceptor/src/authInterceptor.ts:19
Parameters:
Returns: AuthInterceptor
• get pendingRequestCount(): number
Defined in packages/auth-interceptor/src/authInterceptor.ts:24
Returns: number
▸ onIntercept<Body>(request
: HttpFetch‹Body›, options
: NormalizedHttpOptions): HttpFetch‹Body›
Defined in packages/auth-interceptor/src/authInterceptor.ts:28
Type parameters:
▪ Body
Parameters:
Returns: HttpFetch‹Body›
Simple queue that executes Promises one by one.
SimpleQueue
• get length(): number
Defined in packages/auth-interceptor/src/simpleQueue.ts:14
Returns: number
▸ clean(reason
: any): void
Defined in packages/auth-interceptor/src/simpleQueue.ts:36
Parameters:
Returns: void
▸ put<T>(item
: function): Promise‹T›
Defined in packages/auth-interceptor/src/simpleQueue.ts:21
Queues specified promise and returns when it's done
Type parameters:
▪ T
Parameters:
▪ item: function
▸ (): Promise‹T›
Returns: Promise‹T›
Ƭ Promisable: T | Promise‹T›
Defined in packages/auth-interceptor/src/promisable.ts:1
Ƭ QueueItem: object
Defined in packages/auth-interceptor/src/simpleQueue.ts:1
fail(): function
(reason
: any): void
run(): function
(): Promise‹void›
Const
createAuthInterceptor▸ createAuthInterceptor(options
: AuthInterceptorOptions): AuthInterceptor‹›
Defined in packages/auth-interceptor/src/authInterceptor.ts:87
Parameters:
Returns: AuthInterceptor‹›
Const
createOAuth2Interceptor▸ createOAuth2Interceptor(__namedParameters
: object): AuthInterceptor‹›
Defined in packages/auth-interceptor/src/oauth2Interceptor.ts:13
Parameters:
▪ __namedParameters: object
Returns: AuthInterceptor‹›
Const
hasUnauthorizedResponseCode▸ hasUnauthorizedResponseCode(response
: HttpResponse): boolean
Defined in packages/auth-interceptor/src/authInterceptor.ts:14
Parameters:
Returns: boolean
Const
isUnauthorizedError▸ isUnauthorizedError(error
: any): boolean
Defined in packages/auth-interceptor/src/authInterceptor.ts:15
Parameters:
Returns: boolean
OAuth2TokenResponse
• accessToken: string
Optional
expires• expires? : undefined | string
Optional
expiresIn• expiresIn? : undefined | string
Optional
idToken• idToken? : undefined | string
• refreshToken: string
Optional
scope• scope? : undefined | string
Optional
tokenType• tokenType? : undefined | string
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
Defined in
▸ getData(): ‹T | undefined›
Defined in
Returns: ‹T | undefined›
▸ setData(t
: T):
Defined in
Returns:
Name
Type
data
T
Name
Type
options
NormalizedHttpOptions
Name
Type
err
Name
Type
message
string
cause?
Name
Type
options
NormalizedHttpOptions
Name
Type
err
Name
Type
options
NormalizedHttpOptions
Name
Type
options
Name
Type
request
HttpFetch‹Body›
options
NormalizedHttpOptions
Name
Type
reason
any
Name
Type
options
Name
Type
authStorage
canAuthorize
function
oauth
object
onAuthorizationFailure
function
Name
Type
response
HttpResponse
Name
Type
error
any
Name | Type |
| T |