You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Wrong type definition for amr claim in parsed token #254
The TypeScript type definitions in keycloak-js (specifically in keycloak.d.ts) declare the amr (Authentication Methods References) claim as string | undefined, but Keycloak server actually returns it as a JSON array (string[]) per RFC 8176.
This causes TypeScript type mismatches / incorrect IntelliSense when accessing keycloak.tokenParsed.amr, even though the runtime value is correctly an array.
Version
keycloak-js 26.2.2
Expected behavior
Type definition is typed as an array of strings
Actual behavior
Type definition is typed as a string
How to Reproduce?
Use Keycloak server (any recent version, e.g. 26.x) with an authentication flow that includes at least one authenticator reference, for example pwd in Username Password Form.
Initialize keycloak-js adapter in a TypeScript project:
Activity
Parsed token `amr` claim is of type array of strings