@cybergenios/keycloak
v0.1.2-qa.0
Published
<br/>
Downloads
21
Readme
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,
})