# Module: vertx-auth-oauth2-js/keycloak_helper

### Classes

KeycloakHelper

### Methods

#### (static) KeycloakHelper.accessToken(principal) → {Object}

Get decoded `access_token` from the principal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object | user principal

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 108

##### Returns:

the access token

Type
  Object

#### (static) KeycloakHelper.acr(principal) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 147

##### Returns:

Type
  string

#### (static) KeycloakHelper.allowedOrigins(principal) → {Array.<string>}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 212

##### Returns:

Type
  Array.<string>

#### (static) KeycloakHelper.authTime(principal) → {number}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 121

##### Returns:

Type
  number

#### (static) KeycloakHelper.email(principal) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 173

##### Returns:

Type
  string

#### (static) KeycloakHelper.idToken(principal) → {Object}

Get decoded `id_token` from the principal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object | user principal

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 80

##### Returns:

the id token

Type
  Object

#### (static) KeycloakHelper.name(principal) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 160

##### Returns:

Type
  string

#### (static) KeycloakHelper.nickName(principal) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 199

##### Returns:

Type
  string

#### (static) KeycloakHelper.parseToken(token) → {Object}

Parse the token string with base64 decoder. This will only obtain the "payload" part of the token.

##### Parameters:

Name | Type | Description
--- | --- | ---
`token` | string | token string

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 227

##### Returns:

token payload json object

Type
  Object

#### (static) KeycloakHelper.preferredUsername(principal) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 186

##### Returns:

Type
  string

#### (static) KeycloakHelper.rawAccessToken(principal) → {string}

Get raw `access_token` string from the principal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object | user principal

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 94

##### Returns:

the raw access token string

Type
  string

#### (static) KeycloakHelper.rawIdToken(principal) → {string}

Get raw `id_token` string from the principal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object | user principal

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 66

##### Returns:

the raw id token string

Type
  string

#### (static) KeycloakHelper.sessionState(principal) → {string}

##### Parameters:

Name | Type | Description
--- | --- | ---
`principal` | Object |

Source:
  - vertx-auth-oauth2-js/keycloak_helper.js, line 134

##### Returns:

Type
  string