Create a login_hint_token JWT
A login_hint_token is a JWT that provides a way for the client to identify and authenticate the end-user without needing to encode the entire authentication request in a signed JWT. The following information describes the OIDC parameters and the steps for generating and signing the token.
Prerequisites
-
Install a JWT token generator such as jwtgen globally using
npm install -g jwtgen. This action requires npm. -
Retrieve the environment
idproperty value associated with your worker application and user. -
Retrieve the
clientIdandclientSecretproperty values for the worker application. -
Retrieve the user ID
idorusernameproperty value for whom this token will be associated.
|
For non-production applications, you can use the PingOne Login Hint Token Generator to generate a |
Generate a signed token
The header parameters cty and enc must not be included in the login_hint_token JWT header. PingOne does not support nested signing or encryption operations here.
The command to generate the login_hint_token JWT takes the following parameters:
| Parameter | Description |
|---|---|
|
Specifies the JWT signing algorithm. Options are |
|
Specifies the signing key, which is the application’s |
|
Specifies the expiration date, expressed as the number of seconds from the time of creation. The typical value is 3600 seconds. |
|
Specifies the claims required by the token:
|
|
For example, a common |
-
Run the
jwtgencommand.jwtgen -a "HS256" -s "YOUR_CLIENT_SECRET" -e 3600 --claims '{ "iss":"YOUR_CLIENT_ID", "sub":"YOUR_USER_ID_OR_USERNAME", "iat":1300819380, "exp":1300819391, "aud":"https://auth.pingone.com/YOUR_ENVIRONMENT_ID/as" }' -
Record the token returned successfully by the command to use as the value of the
login_hint_tokenproperty in the authorize request.
|
You can use the PingOne JWT Decoder to view the claims information in a JSON Web Token. This utility asks you to provide the JWT token, and it returns a Header (the type of encoded object in the payload), the Payload (the JWT claims set), and the Signature (an encoding of the Header and Payload). |