mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[ACS-8770] update auth service doc file
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
Title: Authentication Service
|
Title: Authentication Service
|
||||||
Added: v2.0.0
|
Added: v2.0.0
|
||||||
Status: Active
|
Status: Active
|
||||||
Last reviewed: 2019-03-19
|
Last reviewed: 2025-06-12
|
||||||
---
|
---
|
||||||
|
|
||||||
# Authentication Service
|
# Authentication Service
|
||||||
@@ -13,27 +13,22 @@ Provides authentication to ACS and APS.
|
|||||||
|
|
||||||
### Methods
|
### Methods
|
||||||
|
|
||||||
- **addTokenToHeader**(headersArg?: `HttpHeaders`): [`Observable`](http://reactivex.io/documentation/observable.html)`<HttpHeaders>`<br/>
|
- **addTokenToHeader**(requestUrl: `string`, headersArg?: `HttpHeaders`): [`Observable`](http://reactivex.io/documentation/observable.html)`<HttpHeaders>`<br/>
|
||||||
Adds the auth token to an HTTP header using the 'bearer' scheme.
|
Adds the auth token to an HTTP header using the 'bearer' scheme.
|
||||||
|
- _requestUrl:_ `string` - The URL of the request for which to set authentication headers.
|
||||||
- _headersArg:_ `HttpHeaders` - (Optional) Header that will receive the token
|
- _headersArg:_ `HttpHeaders` - (Optional) Header that will receive the token
|
||||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<HttpHeaders>` - The new header with the token added
|
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<HttpHeaders>` - The new header with the token added
|
||||||
- **getBearerExcludedUrls**()<br/>
|
|
||||||
Gets the set of URLs that the token bearer is excluded from.
|
|
||||||
- **getRedirect**(): `string`<br/>
|
|
||||||
Gets the URL to redirect to after login.
|
|
||||||
- **Returns** `string` - The redirect URL
|
|
||||||
- **getTicketBpm**(): `string|null`<br/>
|
|
||||||
Gets the BPM ticket stored in the Storage.
|
|
||||||
- **Returns** `string|null` - The ticket or `null` if none was found
|
|
||||||
- **getTicketEcm**(): `string|null`<br/>
|
|
||||||
Gets the ECM ticket stored in the Storage.
|
|
||||||
- **Returns** `string|null` - The ticket or `null` if none was found
|
|
||||||
- **getTicketEcmBase64**(): `string|null`<br/>
|
|
||||||
Gets the BPM ticket from the Storage in Base 64 format.
|
|
||||||
- **Returns** `string|null` - The ticket or `null` if none was found
|
|
||||||
- **getToken**(): `string`<br/>
|
- **getToken**(): `string`<br/>
|
||||||
Gets the auth token.
|
Gets the auth token.
|
||||||
- **Returns** `string` - Auth token string
|
- **Returns** `string` - Auth token string
|
||||||
|
- **getUsername**(): `string`<br/>
|
||||||
|
Gets the username of the authenticated user.
|
||||||
|
- **Returns** `string` - Username of the authenticated user
|
||||||
|
- **getAuthHeaders**(requestUrl: `string`, headers: `HttpHeaders`): `HttpHeaders`<br/>
|
||||||
|
Gets and sets the necessary authentication headers for a given request URL.
|
||||||
|
- _requestUrl:_ `string` - The URL of the request for which to obtain authentication headers.
|
||||||
|
- _headers:_ `HttpHeaders` - The existing HTTP headers to which authentication details might be added.
|
||||||
|
- **Returns** `HttpHeaders` - The HTTP headers object, potentially updated with authentication tokens.
|
||||||
- **isALLProvider**(): `boolean`<br/>
|
- **isALLProvider**(): `boolean`<br/>
|
||||||
Does the provider support both ECM and BPM?
|
Does the provider support both ECM and BPM?
|
||||||
- **Returns** `boolean` - True if both are supported, false otherwise
|
- **Returns** `boolean` - True if both are supported, false otherwise
|
||||||
@@ -52,28 +47,23 @@ Provides authentication to ACS and APS.
|
|||||||
- **isOauth**(): `boolean`<br/>
|
- **isOauth**(): `boolean`<br/>
|
||||||
Does the provider support OAuth?
|
Does the provider support OAuth?
|
||||||
- **Returns** `boolean` - True if supported, false otherwise
|
- **Returns** `boolean` - True if supported, false otherwise
|
||||||
- **isPublicUrl**(): `boolean`<br/>
|
- **login**(username: `string`, password: `string`, rememberMe?: `boolean`): [`Observable`](http://reactivex.io/documentation/observable.html)`<{ type: string; ticket: any }>`<br/>
|
||||||
- **Returns** `boolean` -
|
|
||||||
- **isRememberMeSet**(): `boolean`<br/>
|
|
||||||
Checks whether the "remember me" cookie was set or not.
|
|
||||||
- **Returns** `boolean` - True if set, false otherwise
|
|
||||||
- **login**(username: `string`, password: `string`, rememberMe: `boolean` = `false`): [`Observable`](http://reactivex.io/documentation/observable.html)`<Function>`<br/>
|
|
||||||
Logs the user in.
|
Logs the user in.
|
||||||
- _username:_ `string` - Username for the login
|
- _username:_ `string` - Username for the login
|
||||||
- _password:_ `string` - Password for the login
|
- _password:_ `string` - Password for the login
|
||||||
- _rememberMe:_ `boolean` - Stores the user's login details if true
|
- _rememberMe:_ `boolean` - (Optional) Stores the user's login details if true
|
||||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<Function>` - Object with auth type ("ECM", "BPM" or "ALL") and auth ticket
|
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<{ type: string; ticket: any }>` - An Observable that emits an object containing the authentication type (`type`) and the authentication ticket (`ticket`) upon successful login.
|
||||||
- **logout**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/> Logs the user out.
|
- **logout**(): [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/> Logs the user out.
|
||||||
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Response event called when logout is complete
|
- **Returns** [`Observable`](http://reactivex.io/documentation/observable.html)`<any>` - Response event called when logout is complete
|
||||||
- **reset**()<br/>
|
- **reset**(): `void`<br/>Resets the authentication state of the service.
|
||||||
- **saveRememberMeCookie**(rememberMe: `boolean`)<br/>
|
- **on**(event: `string`, listener: `Function`): `void`<br/> Adds an event listener for the specified event.
|
||||||
Saves the "remember me" cookie as either a long-life cookie or a session cookie.
|
- **off**(event: `string`, listener?: `Function`): `void`<br/> Removes an event listener for the specified event.
|
||||||
- _rememberMe:_ `boolean` - Enables a long-life cookie
|
- **once**(event: `string`, listener: `Function`): `void`<br/> Adds a one-time event listener for the specified event.
|
||||||
- **setRedirect**(url?: [`RedirectionModel`](../../../lib/core/src/lib/auth/models/redirection.model.ts))<br/>
|
- **emit**(event: `string`, ...args: `any[]`): `void`<br/> Emits an event with optional arguments.
|
||||||
Sets the URL to redirect to after login.
|
- **onLogin**: [`Subject`](https://reactivex.io/documentation/subject)`<any>`<br/> Emitted when the user logs in successfully.
|
||||||
- _url:_ [`RedirectionModel`](../../../lib/core/src/lib/auth/models/redirection.model.ts) - (Optional) URL to redirect to
|
- **onLogout**: [`Subject`](https://reactivex.io/documentation/subject)`<any>`<br/> Emitted when the user logs out.
|
||||||
- **ssoImplicitLogin**()<br/>
|
- **onTokenReceived**: [`Subject`](https://reactivex.io/documentation/subject)`<any>`<br/> Emitted when an authentication token is received.
|
||||||
Logs the user in with SSO
|
- **onError**: [`Observable`](http://reactivex.io/documentation/observable.html)`<any>`<br/> An Observable that emits an error object when an authentication-related error occurs.
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user