Service for managing JWT Auth Token from dotCMS Site/Host

### Hierarchy

- JWTAuthService

## Index

### Constructors

- constructor

### Properties

- http
- loggerService
- notificationService
- settingsStorageService

### Methods

- doPostAuth
- extractJWT
- getJWT
- handleError
- login

## Constructors

### constructor

- new JWTAuthService(http: Http, notificationService: NotificationService, loggerService: LoggerService, settingsStorageService: SettingsStorageService): JWTAuthService

- - Defined in core/util/jwt-auth.service.ts:14

  #### Parameters

  - ##### http: Http

  - ##### notificationService: NotificationService

  - ##### loggerService: LoggerService

  - ##### settingsStorageService: SettingsStorageService

  #### Returns JWTAuthService

## Properties

### Private http

http: Http

- Defined in core/util/jwt-auth.service.ts:18

### Private loggerService

loggerService: LoggerService

- Defined in core/util/jwt-auth.service.ts:20

### Private notificationService

notificationService: NotificationService

- Defined in core/util/jwt-auth.service.ts:19

### Private settingsStorageService

settingsStorageService: SettingsStorageService

- Defined in core/util/jwt-auth.service.ts:21

## Methods

### Private doPostAuth

- doPostAuth(siteUrl: string, data: any): Observable<Response>

- - Defined in core/util/jwt-auth.service.ts:64

  #### Parameters

  - ##### siteUrl: string

  - ##### data: any

  #### Returns Observable<Response>

### Private extractJWT

- extractJWT(res: Response): string

- - Defined in core/util/jwt-auth.service.ts:71

  #### Parameters

  - ##### res: Response

  #### Returns string

### getJWT

- getJWT(siteURL: string, username: string, password: string): Observable<string>

- - Defined in core/util/jwt-auth.service.ts:32

  Will POST to the dotCMS to retrieve a dotCMS Auth Token

  #### Parameters

  - ##### siteURL: string

    Site/Host of dotCMS

  - ##### username: string

  - ##### password: string

  #### Returns Observable<string>

  String return for the token

### Private handleError

- handleError(error: any): ErrorObservable

- - Defined in core/util/jwt-auth.service.ts:78

  #### Parameters

  - ##### error: any

  #### Returns ErrorObservable

### login

- login(siteURL: string, username: string, password: string): Observable<string>

- - Defined in core/util/jwt-auth.service.ts:56

  Will login and save the Auth Token to local storage

  #### Parameters

  - ##### siteURL: string

  - ##### username: string

  - ##### password: string

  #### Returns Observable<string>

Generated using TypeDoc