0.1.6 • Published 4 years ago

keycloak-lambda-cloudfront-ui v0.1.6

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
4 years ago

CircleCI

Integration cloudfront ui with keycloak-lambda-authorizer

installation

npm i keycloak-lambda-cloudfront-ui -S

Example

todo

How To use

import {
    getActiveTenantToken
} from 'keycloak-lambda-cloudfront-ui';
import fetch from 'axios';

// get active JWT token. (if expired, the token will be automatically updated)
const jwtToken = await getActiveTenantToken();

const res = await fetch({
    url: 'http://localhost:8080/api',
    method: 'GET',
    headers: {
        Authorization: `Bearer ${jwtToken}`
    },
    withCredentials: true,
});

Functions

  • getTenants() - list of all active tenants
  • getTenantCookie(realm, clientId) - tenant cookie name
  • async reloadToken(realm, clientId, cookieName) - force reload tenant jwt token
  • async getActiveTenantToken(realm, clientId) - get active JWT token. (if expired, the token will be automatically refreshed)
  • async getDecodedTenantToken(realm, clientId) - get payload from JWT token;

realm: tenant realm
clientId: tenant client

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago