mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-1549] Added files for Core library (#2345)
* [ADF-1549] Added files for Core library * [ADF-1549] Updated md files following checks
This commit is contained in:
committed by
Eugenio Romano
parent
12e54da11c
commit
1c6866f7d1
48
docs/authentication.service.md
Normal file
48
docs/authentication.service.md
Normal file
@@ -0,0 +1,48 @@
|
||||
# Authentication Service
|
||||
|
||||
Provides authentication for use with the Login component.
|
||||
|
||||
<!-- markdown-toc start - Don't edit this section. npm run toc to generate it-->
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Basic Usage](#basic-usage)
|
||||
* [Events](#events)
|
||||
- [Details](#details)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
<!-- markdown-toc end -->
|
||||
|
||||
## Basic Usage
|
||||
|
||||
**app.component.ts**
|
||||
|
||||
```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](../ng2-components/ng2-alfresco-login/README.md) and is possible to find there an example of how to use it.
|
Reference in New Issue
Block a user