mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
4.3 KiB
4.3 KiB
Title, Added, Status, Last reviewed
Title | Added | Status | Last reviewed |
---|---|---|---|
Authentication Service | v2.0.0 | Active | 2019-03-19 |
Authentication Service
Provides authentication to ACS and APS.
Class members
Methods
- addTokenToHeader(headersArg?:
HttpHeaders
):Observable
<HttpHeaders>
Adds the auth token to an HTTP header using the 'bearer' scheme.- headersArg:
HttpHeaders
- (Optional) Header that will receive the token - Returns
Observable
<HttpHeaders>
- The new header with the token added
- headersArg:
- getBearerExcludedUrls()
Gets the set of URLs that the token bearer is excluded from. - getRedirect():
string
Gets the URL to redirect to after login.- Returns
string
- The redirect URL
- Returns
- getTicketBpm():
string|null
Gets the BPM ticket stored in the Storage.- Returns
string|null
- The ticket ornull
if none was found
- Returns
- getTicketEcm():
string|null
Gets the ECM ticket stored in the Storage.- Returns
string|null
- The ticket ornull
if none was found
- Returns
- getTicketEcmBase64():
string|null
Gets the BPM ticket from the Storage in Base 64 format.- Returns
string|null
- The ticket ornull
if none was found
- Returns
- getToken():
string
Gets the auth token.- Returns
string
- Auth token string
- Returns
- isALLProvider():
boolean
Does the provider support both ECM and BPM?- Returns
boolean
- True if both are supported, false otherwise
- Returns
- isBPMProvider():
boolean
Does the provider support BPM?- Returns
boolean
- True if supported, false otherwise
- Returns
- isECMProvider():
boolean
Does the provider support ECM?- Returns
boolean
- True if supported, false otherwise
- Returns
- isKerberosEnabled():
boolean
Does kerberos enabled?- Returns
boolean
- True if enabled, false otherwise
- Returns
- isLoggedIn():
boolean
Checks if the user logged in.- Returns
boolean
- True if logged in, false otherwise
- Returns
- isOauth():
boolean
Does the provider support OAuth?- Returns
boolean
- True if supported, false otherwise
- Returns
- isPublicUrl():
boolean
- Returns
boolean
-
- Returns
- isRememberMeSet():
boolean
Checks whether the "remember me" cookie was set or not.- Returns
boolean
- True if set, false otherwise
- Returns
- login(username:
string
, password:string
, rememberMe:boolean
=false
):Observable
<Function>
Logs the user in.- username:
string
- Username for the login - password:
string
- Password for the login - rememberMe:
boolean
- Stores the user's login details if true - Returns
Observable
<Function>
- Object with auth type ("ECM", "BPM" or "ALL") and auth ticket
- username:
- logout():
Observable
<any>
Logs the user out.- Returns
Observable
<any>
- Response event called when logout is complete
- Returns
- reset()
- saveRememberMeCookie(rememberMe:
boolean
)
Saves the "remember me" cookie as either a long-life cookie or a session cookie.- rememberMe:
boolean
- Enables a long-life cookie
- rememberMe:
- setRedirect(url?:
RedirectionModel
)
Sets the URL to redirect to after login.- url:
RedirectionModel
- (Optional) URL to redirect to
- url:
- ssoImplicitLogin()
Logs the user in with SSO
Details
Usage example
import { AuthenticationService } from '@alfresco/adf-core';
@Component({...})
export class AppComponent {
constructor(authService: AuthenticationService) {
this.AuthenticationService.login('admin', 'admin').subscribe(
token => {
console.log(token);
},
error => {
console.log(error);
}
);
}
}