# Class: ChainAuthHandler

## vertx-web-js/chain_auth_handler~ ChainAuthHandler

#### new ChainAuthHandler()

An auth handler that chains to a sequence of handlers.

Source:
  - vertx-web-js/chain_auth_handler.js, line 32

### Methods

#### addAuthorities(authorities) → {AuthHandler}

Add a set of required authorities for this auth handler

##### Parameters:

Name | Type | Description
--- | --- | ---
`authorities` | Array.<string> | the set of authorities

Source:
  - vertx-web-js/chain_auth_handler.js, line 72

##### Returns:

a reference to this, so the API can be used fluently

Type
  AuthHandler

#### addAuthority(authority) → {AuthHandler}

Add a required authority for this auth handler

##### Parameters:

Name | Type | Description
--- | --- | ---
`authority` | string | the authority

Source:
  - vertx-web-js/chain_auth_handler.js, line 57

##### Returns:

a reference to this, so the API can be used fluently

Type
  AuthHandler

#### append(authHandler) → {ChainAuthHandler}

Appends a auth provider to the chain.

##### Parameters:

Name | Type | Description
--- | --- | ---
`authHandler` | AuthHandler | auth handler

Source:
  - vertx-web-js/chain_auth_handler.js, line 129

##### Returns:

self

Type
  ChainAuthHandler

#### authorize(user, handler)

Authorizes the given user against all added authorities.

##### Parameters:

Name | Type | Description
--- | --- | ---
`user` | User | a user.
`handler` | function | the handler for the result.

Source:
  - vertx-web-js/chain_auth_handler.js, line 109

#### clear()

Clears the chain.

Source:
  - vertx-web-js/chain_auth_handler.js, line 157

#### handle(arg0)

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg0` | RoutingContext |

Source:
  - vertx-web-js/chain_auth_handler.js, line 43

#### parseCredentials(context, handler)

Parses the credentials from the request into a JsonObject. The implementation should be able to extract the required info for the auth provider in the format the provider expects.

##### Parameters:

Name | Type | Description
--- | --- | ---
`context` | RoutingContext | the routing context
`handler` | function | the handler to be called once the information is available.

Source:
  - vertx-web-js/chain_auth_handler.js, line 89

#### remove(authHandler) → {boolean}

Removes a provider from the chain.

##### Parameters:

Name | Type | Description
--- | --- | ---
`authHandler` | AuthHandler | provider to remove

Source:
  - vertx-web-js/chain_auth_handler.js, line 144

##### Returns:

true if provider was removed, false if non existent in the chain.

Type
  boolean