# 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

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

#####
Index

### Constructors

constructor

### Properties

originalUrl
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:93

## Properties

### originalUrl

originalUrl: string = window.location.href

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

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

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

### getEmail

- getEmail(): string

- #### Returns string

  User's email

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

### getRolesIds

- getRolesIds(): number[]

- #### Returns number[]

  The roles IDs.

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

### getRolesNames

- getRolesNames(): string[]

- #### Returns string[]

  The roles names.

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

### getUsername

- getUsername(): string

- #### Returns string

  Username

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

### handleDisconnection

- handleDisconnection(): void

- #### Returns void

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

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

### logout

- logout(): Promise<void>

- #### Returns Promise<void>

  Promise.

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

### resetPassword

- resetPassword(login): Promise<AuthenticationDefaultResponse>

- #### Parameters

  - login: string

    Login name.

  #### Returns Promise<AuthenticationDefaultResponse>

  Promise.

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

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

Generated using TypeDoc