oidc-token-hash
oidc-token-hash validates (and generates) ID Token claims like at_hash or c_hash for OpenID Clients
and Providers.
Usage
Validating
const oidcTokenHash = require('oidc-token-hash');
const at_hash = 'x7vk7f6BvQj0jQHYFIk4ag';
const access_token = 'YmJiZTAwYmYtMzgyOC00NzhkLTkyOTItNjJjNDM3MGYzOWIy9sFhvH8K_x8UIHj1osisS57f5DduL-ar_qw5jl3lthwpMjm283aVMQXDmoqqqydDSqJfbhptzw8rUVwkuQbolw';
oidcTokenHash(at_hash, access_token);
oidcTokenHash(at_hash, 'foobar');
oidcTokenHash.valid('foobar', access_token);
Generating
oidcTokenHash.generate(access_token);
oidcTokenHash.generate(access_token, 384);
oidcTokenHash.generate(access_token, 512);