Create a private key JWT
The PRIVATE_KEY_JWT property is a supported value on the application’s tokenEndpointAuthMethod property. This client authentication method uses an external private key to sign a JWT, which is passed in as a property to authenticate the token request.
|
When you use a private key to sign a JWT, you must set the |
For JWT-based client authentication, the token supports the following required and optional claims.
| Claim | Type | Required | Description |
|---|---|---|---|
|
String |
Required |
A string that specifies the issuer. This value must match the application ID (client ID) of the PingOne application. |
|
String |
Required |
A string that specifies the identifier for the authenticated user. This value must match the application ID (client ID) of the PingOne application. |
|
URI |
Required |
A string that lists the audience, the resources for which this token is intended. Valid options are: (1) the token endpoint ( |
|
Timestamp |
Required |
A timestamp, measured in the number of seconds since January 1, 1970, UTC, indicating when this token will expire, as defined in JWT RFC7519. This JWT must not be expired. Tokens that expire more than one hour from now are rejected. |
|
Timestamp |
Optional |
A "not before" timestamp. If present, the JWT must be valid. JWTs are rejected if |
Other properties of the JWT are:
-
The optional
iatandjticlaims from the JSON Web Token (JWT) spec are not validated. Refer to RFC7523 JWT Format and Processing Requirements. -
The JWT can include other claims in addition to those listed above.
-
The JWT must be signed. For
PRIVATE_KEY_JWTsigning, the platform supports the RS256, RS384, and RS512 symmetric keyed hashing algorithm. -
The JWT must be valid.
Generate a keypair
-
Use a keypair generator to create a keypair with the following configuration options. This example uses the
RS256signing algorithm (RS384, andRS512are also supported).-
Key size: 2048
-
Key use: signature
-
Algorithm: RS256
-
Key-ID: SHA-256
-
Show X.509: No
-
-
Save the generated Public and Private Keypair and the Public Key.
-
Example public and private keypair
{ "p": "x1mRR-Y1_i8ZPTLe2sPmuif4hhIfaxSph8m_iACDEHvAfTh0RMV7SrExscRSUXzcWX_FbSIKE5tDm4c1qzImnmWz06z6SSQYUjl0iU6V439sebR662deH5kOF92Vbtj5OLk-mNdj-fm6CdwnWEp3vb36T9kOiKHGReluwJpG1I8", "kty": "RSA", "q": "tY0osG4YzkzTX_NCxN3QBFinw_hvJLX6zVXZ-PGHTOD0iFsdwCzmqa3o6_4-GtHUSiuoboTscx2ItbU824IDp41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aJov6FgUTE2Xm_B9SqJu55qmS3CxVhvYWSpRIZvhrgap19CE_VnrAc5pzwj2oSEmDRXXFSGmMjHAmfTXU66nDZVmhbtDIBkPU-h55RDZf6zIn3SPOrmWJYj0G5X2fMJfbUOpuROjH1aMqqGOxcT-dX-LA0dd94LrH4J-g1HFeGZqw-uyQO8l1g6fbQYVaNvnHtw9V7U7I684Ks-3sZcU-YhexNhiN53izIglhdVva9pjSTUk4BnmYtSlfyF6HzUYkvg3H1S0Y6LqzW8lOIw8SF-L6jQqkT2DPDwDbxzNoaNx8lIE0Q" } -
Example public key
{ "kty": "RSA", "e": "AQAB", "use": "sig", "kid": "q3sWApYjHZQLmWMUdAIqZiVWSshDdau5eI4K_Bm65Us", "alg": "RS256", "n": "jWA_vDxg41NrYJdIiv3BcljMy7V15bMyOyK5aJov6FgUTE2Xm_B9SqJu55qmS3CxVhvYWSpRIZvhrgap19CE_VnrAc5pzwj2oSEmDRXXFSGmMjHAmfTXU66nDZVmhbtDIBkPU-h55RDZf6zIn3SPOrmWJYj0G5X2fMJfbUOpuROjH1aMqqGOxcT-dX-LA0dd94LrH4J-g1HFeGZqw-uyQO8l1g6fbQYVaNvnHtw9V7U7I684Ks-3sZcU-YhexNhiN53izIglhdVva9pjSTUk4BnmYtSlfyF6HzUYkvg3H1S0Y6LqzW8lOIw8SF-L6jQqkT2DPDwDbxzNoaNx8lIE0Q" }
-
Generate a signed JWT
-
Create a signed JWT with with a signing algorithm of
RS256,RS384, orRS512and header and payload information shown below.-
Header
{ "alg": "RS256", "typ": "JWT" } -
Payload
{ "iss": "{{appID}}", "sub": "{{appID}}", "exp": 1691085204, "aud": "https://auth.pingone.com/{{envID}}/as/token" }
-
-
Record the token returned successfully.
|
The value for |
Use the JWT in a token request
For applications that set the tokenEndpointAuthMethod to PRIVATE_KEY_JWT, the token request requires the following two properties:
-
client_assertionA JWT that contains a signed assertion with the application’s credentials. This is the JWT that you generated and signed with your private key.
-
client_assertion_typeA string that specifies the client assertion type. The value of this property must be set to
urn:ietf:params:oauth:client-assertion-type:jwt-bearer.
For more information about the token request, refer to Token.