alfresco-ng2-components/docs/core/services/authentication.service.md
Maurizio Vitale 1fa81962a0
👽 Angular 14 rebase 👽 (#7769)
* fix after rebase

* new release strategy for ng next

Signed-off-by: eromano <eugenioromano16@gmail.com>

* peer dep

Signed-off-by: eromano <eugenioromano16@gmail.com>

* Angular 14

fix unit test and storybook

Signed-off-by: eromano <eugenioromano16@gmail.com>

fix after rebase

Signed-off-by: eromano <eugenioromano16@gmail.com>

update pkg.json

Signed-off-by: eromano <eugenioromano16@gmail.com>

missing dep

Signed-off-by: eromano <eugenioromano16@gmail.com>

Fix mistake and missing code

Dream....build only affected libs

Add utility run commands

* Use nx command to run affected tests

* Fix nx test core

fix content tests

Run unit with watch false

core test fixes

reduce test warnings

Fix process cloud unit

Fix adf unit test

Fix lint process cloud

Disable lint next line

Use right core path

Fix insights unit

fix linting insights

Fix process-services unit

fix the extensions test report

fix test warnings

Fix content unit

Fix bunch of content unit

* Produce an adf alpha of 14

* hopefully fixing the content

* Push back the npm publish

* Remove flaky unit

* Fix linting

* Make the branch as root

* Get rid of angualar13

* Remove the travis depth

* Fixing version for npm

* Enabling cache for unit and build

* Fix scss for core and paths

Copy i18 and asset by using ng-packager

Export the theming alias and fix path

Use ng-package to copy assets process-services-cloud

Use ng-package to copy assets process-services

Use ng-package to copy assets content-services

Use ng-package to copy assets insights

* feat: fix api secondary entry point

* fix storybook rebase

* Move dist under dist/libs from lib/dist

* Fix the webstyle

* Use only necessary nrwl deps and improve lint

* Fix unit for libs

* Convert lint.sh to targets - improve performance

* Use latest of angular

* Align alfresco-js-api

Signed-off-by: eromano <eugenioromano16@gmail.com>
Co-authored-by: eromano <eugenioromano16@gmail.com>
Co-authored-by: Mikolaj Serwicki <mikolaj.serwicki@hyland.com>
Co-authored-by: Tomasz <tomasz.gnyp@hyland.com>
2022-08-25 10:50:30 +01:00

5.8 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
  • getBearerExcludedUrls(): string[]
    Gets the set of URLs that the token bearer is excluded from.

    • Returns string[] - Array of URL strings
  • getBpmLoggedUser(): Observable<UserRepresentation>
    Gets information about the user currently logged into APS.

  • getBpmUsername(): string
    Gets the BPM username

    • Returns string - The BPM username
  • getEcmUsername(): string
    Gets the ECM username.

    • Returns string - The ECM username
  • getRedirect(): string
    Gets the URL to redirect to after login.

    • Returns string - The redirect URL
  • getTicketBpm(): string|null
    Gets the BPM ticket stored in the Storage.

    • Returns string|null - The ticket or null if none was found
  • getTicketEcm(): string|null
    Gets the ECM ticket stored in the Storage.

    • Returns string|null - The ticket or null if none was found
  • getTicketEcmBase64(): string|null
    Gets the BPM ticket from the Storage in Base 64 format.

    • Returns string|null - The ticket or null if none was found
  • getToken(): string
    Gets the auth token.

    • Returns string - Auth token string
  • handleError(error: any): Observable<any>
    Prints an error message in the console browser

    • error: any - Error message
    • Returns Observable<any> - Object representing the error message
  • isALLProvider(): boolean
    Does the provider support both ECM and BPM?

    • Returns boolean - True if both are supported, false otherwise
  • isBPMProvider(): boolean
    Does the provider support BPM?

    • Returns boolean - True if supported, false otherwise
  • isBpmLoggedIn(): boolean
    Checks if the user is logged in on a BPM provider.

    • Returns boolean - True if logged in, false otherwise
  • isECMProvider(): boolean
    Does the provider support ECM?

    • Returns boolean - True if supported, false otherwise
  • isEcmLoggedIn(): boolean
    Checks if the user is logged in on an ECM provider.

    • Returns boolean - True if logged in, false otherwise
  • isKerberosEnabled(): boolean
    Does kerberos enabled?

    • Returns boolean - True if enabled, false otherwise
  • isLoggedIn(): boolean
    Checks if the user logged in.

    • Returns boolean - True if logged in, false otherwise
  • isLoggedInWith(provider: string): boolean

    • provider: string -
    • Returns boolean -
  • isOauth(): boolean
    Does the provider support OAuth?

    • Returns boolean - True if supported, false otherwise
  • isPublicUrl(): boolean

    • Returns boolean -
  • isRememberMeSet(): boolean
    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<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
  • logout(): Observable<any>
    Logs the user out.

    • Returns Observable<any> - Response event called when logout is complete
  • setRedirect(url: RedirectionModel)
    Sets the URL to redirect to after login.

  • 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);
            }
        );
    }
}

See also