1.0.12 • Published 1 month ago
idmission-auth-client v1.0.12
IDmission Auth Client for NodeJS
This package allows NodeJS applications to generate tokens for use with IDmission technology.
Installation
npm i idmission-auth-client
Basic Usage for Client-to-Server Interactions (Sessions)
Set the following environment variables in your server's runtime environment:
export IDMISSION_API_KEY_ID="your-idmission-api-key-id"
export IDMISSION_API_KEY_SECRET="your-idmission-api-secret"
Optionally, you may override the URL to the IDmission Session Service (leave blank to stick with https://portal-api.idmission.com
):
# This is not required in most use-cases.
export IDMISSION_SESSIONS_SERVICE_URL="some-other-idmission-sessions-service-url"
New customers receive their API keys via email. If you haven't received them, reach out to support@idmission.com.
To generate a session in your server-side application code:
import { IDmissionSessionGenerator } from "idmission-auth-client";
const session = await new IDmissionSessionGenerator().generate()
Basic Usage for Server-to-Server Interactions (JSON Web Tokens)
Set the following environment variables in your server's runtime environment:
export IDMISSION_AUTH_HOST="https://auth.idmission.com"
export IDMISSION_CLIENT_ID="your-idmission-client-id"
export IDMISSION_CLIENT_SECRET="your-idmission-client-secret"
export IDMISSION_USERNAME="your-idmission-username"
export IDMISSION_PASSWORD="your-idmission-password"
New customers receive their token generation credentials via email. If you haven't received them, reach out to support@idmission.com.
To generate a token in your server-side application code:
import { IDmissionTokenGenerator } from "idmission-auth-client";
const token = await new IDmissionTokenGenerator().generate()