arlas-wui-toolkit / Exports / ArlasIamService
Class: ArlasIamService
Hierarchy
↳ ArlasIamService
Table of contents
Constructors
Properties
Methods
- areSettingsValid
- change
- clearStore
- consumeReloadState
- createPermission
- declareReloadState
- forgot
- getAccessToken
- getOrganisation
- initAuthService
- isAuthenticated
- login
- logout
- logoutWithoutRedirection$
- notifyTokenRefresh
- refresh
- reset
- setArlasIamApi
- setHeaders
- setHeadersFromAccesstoken
- setOptions
- signUp
- startRefreshTokenTimer
- stopRefreshTokenTimer
- storeAccessToken
- storeOrganisation
- verify
Constructors
constructor
• new ArlasIamService(router
, settings
)
Parameters
Name | Type |
---|---|
router |
Router |
settings |
ArlasSettingsService |
Overrides
ArlasAuthentificationService.constructor
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:59
Properties
authConfigValue
• authConfigValue: AuthentSetting
Inherited from
ArlasAuthentificationService.authConfigValue
Defined in
projects/arlas-toolkit/src/lib/services/arlas-authentification/arlas-authentification.service.ts:28
reloadState
• reloadState: string
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:56
storage
• storage: Map
<any
, any
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:57
tokenRefreshed$
• tokenRefreshed$: Observable
<LoginData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:54
user
• user: UserData
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:55
Methods
areSettingsValid
▸ areSettingsValid(authentSetting
): [boolean
, string
]
Parameters
Name | Type |
---|---|
authentSetting |
AuthentSetting |
Returns
[boolean
, string
]
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:223
change
▸ change(oldPassword
, newPassword
): Observable
<UserData
>
Parameters
Name | Type |
---|---|
oldPassword |
string |
newPassword |
string |
Returns
Observable
<UserData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:315
clearStore
▸ clearStore(): void
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:246
consumeReloadState
▸ consumeReloadState(): void
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:70
createPermission
▸ createPermission(oid
, permissionDef
): Observable
<PermissionData
>
Parameters
Name | Type |
---|---|
oid |
string |
permissionDef |
PermissionDef |
Returns
Observable
<PermissionData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:319
declareReloadState
▸ declareReloadState(reloadState
): void
Parameters
Name | Type |
---|---|
reloadState |
any |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:66
forgot
▸ forgot(email
): Observable
<ArlasMessage
>
Parameters
Name | Type |
---|---|
email |
string |
Returns
Observable
<ArlasMessage
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:311
getAccessToken
▸ getAccessToken(): string
Returns
string
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:114
getOrganisation
▸ getOrganisation(): string
Gets organisation from localstorage. The method checks if the organisation is defined If not returned the first of the list in user's organisations.
Returns
string
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:122
initAuthService
▸ initAuthService(): Promise
<void
>
Returns
Promise
<void
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:183
isAuthenticated
▸ isAuthenticated(): boolean
Returns
boolean
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:219
login
▸ login(email
, password
): Observable
<LoginData
>
Parameters
Name | Type |
---|---|
email |
string |
password |
string |
Returns
Observable
<LoginData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:286
logout
▸ logout(redirectPageAfterLogout?
): void
Parameters
Name | Type |
---|---|
redirectPageAfterLogout |
string [] |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:264
logoutWithoutRedirection$
▸ logoutWithoutRedirection$(): Observable
<ArlasMessage
>
Returns
Observable
<ArlasMessage
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:251
notifyTokenRefresh
▸ notifyTokenRefresh(loginData
): void
Parameters
Name | Type |
---|---|
loginData |
LoginData |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:137
refresh
▸ refresh(): Observable
<LoginData
>
Returns
Observable
<LoginData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:272
reset
▸ reset(userId
, token
, password
): Observable
<UserData
>
Parameters
Name | Type |
---|---|
userId |
string |
token |
string |
password |
string |
Returns
Observable
<UserData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:307
setArlasIamApi
▸ setArlasIamApi(api
): void
Parameters
Name | Type |
---|---|
api |
ArlasIamApi |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:80
setHeaders
▸ setHeaders(org
, accessToken
): void
Stores the given org and access token in localstorage + set iamService headers.
Parameters
Name | Type |
---|---|
org |
string |
accessToken |
string |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:100
setHeadersFromAccesstoken
▸ setHeadersFromAccesstoken(accessToken
): void
- Strores the given access token in localstorage
- Set the headers of iamService with an already stored organisation in localstorage.
Parameters
Name | Type |
---|---|
accessToken |
string |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:87
setOptions
▸ setOptions(options
): void
Parameters
Name | Type |
---|---|
options |
any |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:76
signUp
▸ signUp(email
): Observable
<UserData
>
Parameters
Name | Type |
---|---|
email |
string |
Returns
Observable
<UserData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:299
startRefreshTokenTimer
▸ startRefreshTokenTimer(loginData
): void
This method should be called right after being logged in THUS; there is no need to refresh the token at 0; we can wait for the moment the token is about to expire to start the timer. By doing this we avoid refreshing the token twice in a row. Also starting the refresh at 0 causes some incoherence in localstorage when we activate 'redirect_uri' parameter in settings.yaml
Parameters
Name | Type |
---|---|
loginData |
LoginData |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:154
stopRefreshTokenTimer
▸ stopRefreshTokenTimer(): void
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:239
storeAccessToken
▸ storeAccessToken(accessToken
): void
Parameters
Name | Type |
---|---|
accessToken |
string |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:110
storeOrganisation
▸ storeOrganisation(organisation
): void
Parameters
Name | Type |
---|---|
organisation |
string |
Returns
void
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:133
verify
▸ verify(userId
, token
, password
): Observable
<UserData
>
Parameters
Name | Type |
---|---|
userId |
string |
token |
string |
password |
string |
Returns
Observable
<UserData
>
Defined in
projects/arlas-toolkit/src/lib/services/arlas-iam/arlas-iam.service.ts:303