alfresco-ng2-components/docs/authentication.service.md
Andy Stark 1c6866f7d1 [ADF-1549] Added files for Core library (#2345)
* [ADF-1549] Added files for Core library

* [ADF-1549] Updated md files following checks
2017-09-18 16:52:56 +01:00

1.0 KiB

Authentication Service

Provides authentication for use with the Login component.

Basic Usage

app.component.ts

import { AuthenticationService } from 'ng2-alfresco-core';

@Component({...})
export class AppComponent {
    constructor(authService: AuthenticationService) {
        this.AuthenticationService.login('admin', 'admin').subscribe(
            token => {
                console.log(token);
            },
            error => {
                console.log(error);
            }
        );
    }
}

Events

Name Description
onLogin Raised when user logs in
onLogout Raised when user logs out

Details

The authentication service is used inside the login component and is possible to find there an example of how to use it.