# Class AuthManager

### Hierarchy

- AuthManager

### Constructors

- constructor

### Properties

- userName

### Methods

- checkSession
- logIn
- logOut

## Constructors

### constructor

- new AuthManager(serverUrl: string, serverType: ServerType, requestClient: RequestClient, loginCallback: function): AuthManager

- - Defined in src/auth/AuthManager.ts:9

  #### Parameters

  - ##### serverUrl: string

  - ##### serverType: ServerType

  - ##### requestClient: RequestClient

  - ##### loginCallback: function

    - - (): Promise<void>

      - #### Returns Promise<void>

  #### Returns AuthManager

## Properties

### userName

userName: string = ""

- Defined in src/auth/AuthManager.ts:7

## Methods

### checkSession

- checkSession(): Promise<object>

- - Defined in src/auth/AuthManager.ts:84

  Checks whether a session is active, or login is required.

  #### Returns Promise<object>

  - a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`.

### logIn

- logIn(username: string, password: string): Promise<object>

- - Defined in src/auth/AuthManager.ts:28

  Logs into the SAS server with the supplied credentials.

  #### Parameters

  - ##### username: string

    a string representing the username.

  - ##### password: string

    a string representing the password.

  #### Returns Promise<object>

### logOut

- logOut(): Promise<boolean>

- - Defined in src/auth/AuthManager.ts:165

  Logs out of the configured SAS server.

  #### Returns Promise<boolean>

Generated using TypeDoc