# 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:66

#####
Index

### Constructors

constructor

### Properties

verifyConnection_

### Methods

changePassword
checkUser_
getEmail
getRolesIds
getRolesNames
getUsername
handleDisconnection
login
logout
resetPassword
resetUser

## Constructors

### constructor

- new AuthenticationService(): AuthenticationService

- #### Returns AuthenticationService

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

## Properties

### verifyConnection_

verifyConnection_: number

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

## Methods

### changePassword

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

- #### 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>

  Promise.

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

### checkUser_

- checkUser_(data): User

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

  #### Parameters

  - ##### data: User

    Ajax response.

  #### Returns User

  Response.

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

### getEmail

- getEmail(): string

- #### Returns string

  User's email

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

### getRolesIds

- getRolesIds(): number[]

- #### Returns number[]

  The roles IDs.

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

### getRolesNames

- getRolesNames(): string[]

- #### Returns string[]

  The roles names.

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

### getUsername

- getUsername(): string

- #### Returns string

  Username

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

### handleDisconnection

- handleDisconnection(): void

- #### Returns void

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

### login

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

- #### Parameters

  - ##### login: string

    Login name.

  - ##### pwd: string

    Password.

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

    One-time password.

  #### Returns Promise<void | User>

  Promise.

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

### logout

- logout(): Promise<void>

- #### Returns Promise<void>

  Promise.

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

### resetPassword

- resetPassword(login): Promise<AuthenticationDefaultResponse>

- #### Parameters

  - ##### login: string

    Login name.

  #### Returns Promise<AuthenticationDefaultResponse>

  Promise.

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

### resetUser

- resetUser(userState, noReload): 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:357

Generated using TypeDoc