Skip to main content

Class: AuthService

Hierarchy

Constructors

constructor

new AuthService()

Inherited from

DefaultGlobalService.constructor

Properties

[combinedReducers]

[combinedReducers]: (state: any, action: any) => any

Type declaration

▸ (state, action): any

Parameters
NameType
stateany
actionany
Returns

any

Inherited from

DefaultGlobalService.[combinedReducers]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:63


[dispatch]

[dispatch]: any

Inherited from

DefaultGlobalService.[dispatch]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:62


[inReducer]

[inReducer]: boolean

Inherited from

DefaultGlobalService.[inReducer]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:64


[reducers]

[reducers]: any

Inherited from

DefaultGlobalService.[reducers]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:59


[sagas]

[sagas]: any

Inherited from

DefaultGlobalService.[sagas]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:61


[types]

[types]: any

Inherited from

DefaultGlobalService.[types]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:60


context

context: AppContext

Inherited from

DefaultGlobalService.context

Defined in

onekijs/packages/onekijs-framework/src/app/AppService.ts:8


state

state: AnyState

Inherited from

DefaultGlobalService.state

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:66

Methods

[create]

[create](initialState): void

Parameters

NameType
initialStateAnyState

Returns

void

Inherited from

DefaultGlobalService.[create]

Defined in

onekijs/packages/onekijs-framework/src/core/Service.ts:69


[run]

[run](): void

Returns

void

Inherited from

DefaultGlobalService.[run]

Defined in

onekijs/packages/onekijs-framework/src/app/GlobalService.ts:7


[stop]

[stop](): void

Returns

void

Inherited from

DefaultGlobalService.[stop]

Defined in

onekijs/packages/onekijs-framework/src/app/GlobalService.ts:15


clear

clear(onError?, onSuccess?): Generator<void, void, unknown>

Clear all authentication data from the redux store and the persistence storage

Parameters

NameType
onError?ErrorCallback<BasicError>
onSuccess?SuccessCallback<any>

Returns

Generator<void, void, unknown>

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:155


fetchSecurityContext

fetchSecurityContext(onError?, onSuccess?): Generator<string | void | Promise<any> | Generator<void | AnonymousObject<any>, undefined | null | string | AnonymousObject<any>, string & string & AnonymousObject<any>>, undefined | null | AnonymousObject<any>, null | AnonymousObject<any>>

Get the security context from the server and save it

Parameters

NameType
onError?ErrorCallback<BasicError>
onSuccess?SuccessCallback<any>

Returns

Generator<string | void | Promise<any> | Generator<void | AnonymousObject<any>, undefined | null | string | AnonymousObject<any>, string & string & AnonymousObject<any>>, undefined | null | AnonymousObject<any>, null | AnonymousObject<any>>

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:185


loadToken

loadToken(onError?, onSuccess?): Generator<void | AnonymousObject<any>, undefined | null | string | AnonymousObject<any>, string & string & AnonymousObject<any>>

Load the token from the persistence storage to the redux store

Parameters

NameType
onError?ErrorCallback<BasicError>
onSuccess?SuccessCallback<any>

Returns

Generator<void | AnonymousObject<any>, undefined | null | string | AnonymousObject<any>, string & string & AnonymousObject<any>>

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:268


refreshToken

refreshToken(token, idp, force?, onError?): undefined | AnonymousObject<any>

Refresh the token against an IDP

Parameters

NameTypeDefault value
tokenAnonymousObject<any>undefined
idpIdpundefined
forcebooleanfalse
onError?ErrorCallback<BasicError>undefined

Returns

undefined | AnonymousObject<any>

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:349


saveToken

saveToken(token, idp, onError?): Generator<void | Promise<boolean> | ForkEffect<undefined | AnonymousObject<any>>, null | string | AnonymousObject<any>, boolean>

Validate the token and save it in the store and persistence storage and trigger the refreshing of the token if applicable

Parameters

NameType
tokenstring | AnonymousObject<any>
idpIdp
onError?ErrorCallback<BasicError>

Returns

Generator<void | Promise<boolean> | ForkEffect<undefined | AnonymousObject<any>>, null | string | AnonymousObject<any>, boolean>

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:455


setIdp

setIdp(idp?): void

Save the idp name in the redux store

Parameters

NameTypeDescription
idp?Idp: the IDP to save (full object). Can be null for removal

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:104


setSecurityContext

setSecurityContext(securityContext?): void

Save the security context in the redux store

Parameters

NameTypeDescription
securityContext?null | AnonymousObject<any>: the security context to save

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:25


setToken

setToken(token): void

Save the token in the redux store

Parameters

NameTypeDescription
tokennull | string | AnonymousObject<any>: the token to save

Returns

void

Defined in

onekijs/packages/onekijs-framework/src/auth/AuthService.ts:35