# Class AuthManager

### Hierarchy

- AuthManager

### Constructors

- constructor

### Properties

- userName

### Methods

- checkSession
- logIn
- logInSasjs
- logOut
- redirectedLogIn

## Constructors

### constructor

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

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

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

## Methods

### checkSession

- checkSession(): Promise<object>

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

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

  #### Returns Promise<object>

  - a promise which resolves with an object containing three values
  - a boolean `isLoggedIn`
  - a string `userName` and
  - a form `loginForm` if not loggedin.

### logIn

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

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

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

  - a boolean `isLoggedin` and a string `username`

### logInSasjs

- logInSasjs(username: string, password: string, clientId: string): Promise<LoginResult>

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

  Logs into the SAS server with the supplied credentials.

  #### Parameters

  - ##### username: string

  - ##### password: string

    a string representing the password.

  - ##### clientId: string

    a string representing the client ID.

  #### Returns Promise<LoginResult>

  - a boolean `isLoggedin` and a string `username`

### logOut

- logOut(): Promise<false | true | object>

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

  Logs out of the configured SAS server.

  #### Returns Promise<false | true | object>

### redirectedLogIn

- redirectedLogIn(__namedParameters: object): Promise<LoginResult>

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

  Opens Pop up window to SAS Login screen. And checks if user has finished login process.

  #### Parameters

  - ##### __namedParameters: object

    - ##### onLoggedOut: undefined | function

  #### Returns Promise<LoginResult>

Generated using TypeDoc