# Class AuthenticationService

An "authentication" service for a GeoMapFish application. Upon loading, it launches a request to determine whether a user is currently logged in or not.

The possible API requests it supports, which are all self-explanatory, are:

- changePassword
- login
- logout
- resetPassword

#### Hierarchy

- AuthenticationService

- Defined in src/auth/service.ts:55

#####
Index

### Constructors

constructor

### Properties

verifyConnection_

### Methods

changePassword
checkUser_
getEmail
getRolesIds
getRolesNames
getUsername
handleDisconnection
login
logout
onSuccessfulLogin
resetPassword
resetUser

## Constructors

### constructor

- new AuthenticationService(): AuthenticationService

- #### Returns AuthenticationService

  - Defined in src/auth/service.ts:80

## Properties

### verifyConnection_

verifyConnection_: number

- Defined in src/auth/service.ts:78

## Methods

### changePassword

- changePassword(login: string, oldPwd: string, newPwd: string, confPwd: string, otp??: string): Promise<void>

- ### Returns

  Promise.

  #### Parameters

  - ##### login: string

    Login.

  - ##### oldPwd: string

    Old password.

  - ##### newPwd: string

    New password.

  - ##### confPwd: string

    New password confirmation.

  - ##### `Optional` otp: string = undefined

    One-time password.

  #### Returns Promise<void>

  - Defined in src/auth/service.ts:180

### checkUser_

- checkUser_(data: User): User

- Check the user to have a user with all parameters in all cases.

  ### Returns

  Response.

  #### Parameters

  - ##### data: User

    Ajax response.

  #### Returns User

  - Defined in src/auth/service.ts:249

### getEmail

- getEmail(): string

- ### Returns

  User's email

  #### Returns string

  - Defined in src/auth/service.ts:308

### getRolesIds

- getRolesIds(): number[]

- ### Returns

  The roles IDs.

  #### Returns number[]

  - Defined in src/auth/service.ts:315

### getRolesNames

- getRolesNames(): string[]

- ### Returns

  The roles names.

  #### Returns string[]

  - Defined in src/auth/service.ts:322

### getUsername

- getUsername(): string

- ### Returns

  Username

  #### Returns string

  - Defined in src/auth/service.ts:301

### handleDisconnection

- handleDisconnection(): void

- #### Returns void

  - Defined in src/auth/service.ts:147

### login

- login(login: string, pwd: string, otp??: string): Promise<void | User>

- ### Returns

  Promise.

  #### Parameters

  - ##### login: string

    Login name.

  - ##### pwd: string

    Password.

  - ##### `Optional` otp: string = undefined

    One-time password.

  #### Returns Promise<void | User>

  - Defined in src/auth/service.ts:218

### logout

- logout(): Promise<void>

- ### Returns

  Promise.

  #### Returns Promise<void>

  - Defined in src/auth/service.ts:271

### onSuccessfulLogin

- onSuccessfulLogin(data: User): User

- Method defined in the aim to be replaced.

  ### Returns

  Response.

  #### Parameters

  - ##### data: User

    Ajax response.

  #### Returns User

  - Defined in src/auth/service.ts:264

### resetPassword

- resetPassword(login: string): Promise<AuthenticationDefaultResponse>

- ### Returns

  Promise.

  #### Parameters

  - ##### login: string

    Login name.

  #### Returns Promise<AuthenticationDefaultResponse>

  - Defined in src/auth/service.ts:284

### resetUser

- resetUser(userState: UserState, noReload: boolean): void

- #### Parameters

  - ##### userState: UserState

    state of the user.

  - ##### noReload: boolean

    Don't request a new user object from the back-end after logging out, defaults to false.

  #### Returns void

  - Defined in src/auth/service.ts:356

Generated using TypeDoc