
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ts-keycloak-authentication
Advanced tools
Typescript package for Keycloak authentication
Typescript Keycloak authentication package for handling internal service-to-service authentication within Fidel API services using Keycloak.
You can install the package using npm:
npm install @fidel.uk/ts-keycloak-authentication
import KeycloakAuthentication, {
KeycloakAuthenticationConfig,
} from '@fidel.uk/ts-keycloak-authentication';
import { Log } from '@fidel.uk/ts-logger';
// Define your Keycloak configuration
const keycloakAuthenticationConfig: KeycloakAuthenticationConfig = {
clientId: 'your-keycloak-client-id',
clientSecret: 'your-keycloak-client-secret',
};
// Create an instance of the logger
const logger = new Log(/* your logger configuration */);
// Create an instance of the KeycloakAuthentication
const authentication = new KeycloakAuthentication(
keycloakAuthenticationConfig,
logger,
);
(async () => {
try {
const accessToken = await authentication.getAccessToken();
// console.log("Access Token:", accessToken);
} catch (error) {
console.error('Authentication error:', error);
}
})();
The KeycloakAuthentication
constructor supports an KeycloakAuthenticationConfig
configuration object:
Parameter | Type | Required | Description |
---|---|---|---|
clientId | string | yes | The client ID for your Keycloak client. |
clientSecret | string | yes | The client secret for your Keycloak client. |
keycloakUrl | string | no | The URL of your Keycloak server. If not provided, it defaults to the stage-based URLs: "dev" - https://auth.platform.fidelapi.rocks ; "prod" - https://auth.platform.fidelapi.com |
realmName | string | no | The realm name for your Keycloak setup. Defaults to "fidelapi". |
stage | string | no | The environment stage, either "dev" or "prod". Defaults to "prod". |
npm ci
npm run lint
npm run prettier:fix
npm run test
npm run test:coverage
FAQs
Typescript package for Keycloak authentication
The npm package ts-keycloak-authentication receives a total of 0 weekly downloads. As such, ts-keycloak-authentication popularity was classified as not popular.
We found that ts-keycloak-authentication demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.