@cybergenios/keycloak
TypeScript icon, indicating that this package has built-in type declarations

0.1.2-qa.0 • Public • Published

Keycloak integration by CyberGênios


Needed Environment Variables

  KEYCLOAK_URL=
  KEYCLOAK_CLIENT_ID=
  KEYCLOAK_CLIENT_SECRET=
  KEYCLOAK_ADMIN_USERNAME=
  KEYCLOAK_ADMIN_PASSWORD=
  KEYCLOAK_REALM=
  KEYCLOAK_EXPIRATION_TOKEN_IN_SECONDS=60

Import the lib

  import Keycloak from '@cybergenios/keycloak'

UserRepresentation

{
  id: string;
  createdTimestamp?: number;
  username?: string;
  enabled?: boolean;
  totp?: boolean;
  emailVerified?: boolean;
  disableableCredentialTypes?: string[];
  requiredActions?: RequiredActionAlias[];
  notBefore?: number;
  access?: Record<string, boolean>;
  attributes?: Record<string, any>;
  clientConsents?: UserConsentRepresentation[];
  clientRoles?: Record<string, any>;
  credentials?: CredentialRepresentation[];
  email?: string;
  federatedIdentities?: FederatedIdentityRepresentation[];
  federationLink?: string;
  firstName?: string;
  groups?: string[];
  lastName?: string;
  origin?: string;
  realmRoles?: string[];
  self?: string;
  serviceAccountClientId?: string;
}

Authenticate User

  /**
   * @returns UserRepresentation
   **/
  Keycloak.loginUser({
    username: string,
    password: string,
    realm: string,
    clientId: string,
    clientSecret: string,
  })

Readme

Keywords

none

Package Sidebar

Install

npm i @cybergenios/keycloak

Weekly Downloads

4

Version

0.1.2-qa.0

License

ISC

Unpacked Size

64.1 kB

Total Files

56

Last publish

Collaborators

  • cybergenios