Skip to content

Commit

Permalink
Merge pull request #45530 from sberyozkin/jwt_quickstart_doc_updates
Browse files Browse the repository at this point in the history
Minor JWT quickstart doc updates
  • Loading branch information
sberyozkin authored Jan 14, 2025
2 parents 947988b + 7f50d40 commit c085eeb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/src/main/asciidoc/security-jwt.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public class TokenSecuredResource {
<6> Retrieves the name of the `Principal`.
<7> Builds a response containing the caller's name, the `isSecure()` and `getAuthenticationScheme()` states of the request `SecurityContext`, and whether a non-null `JsonWebToken` was injected.

[[run-application]]
=== Run the application

Now you are ready to run our application. Use:
Expand Down Expand Up @@ -365,7 +366,7 @@ public class GenerateToken {
}
----

<1> The `iss` claim is the issuer of the JWT.
<1> Set JWT issuer as an `iss` claim value.
This must match the server side `mp.jwt.verify.issuer` for the token to be accepted as valid.
<2> The `upn` claim is defined by the {mp-jwt} spec as the preferred claim to use for the `Principal` seen by the container security APIs.
<3> The `group` claim provides the groups and top-level roles associated with the JWT bearer.
Expand Down Expand Up @@ -433,8 +434,9 @@ openssl pkcs8 -topk8 -nocrypt -inform pem -in rsaPrivateKey.pem -outform pem -ou
You can use the generated key pair instead of those used in this quickstart.
====

Now, you can generate a JWT to use with the `TokenSecuredResource` endpoint.
To do this, run the following command:
Ensure the <<run-application, application is running>> before generating the JSON Web Token (JWT) for the `TokenSecuredResource` endpoint.

Next, use the following command to generate the JWT:

.Command to generate JWT

Expand Down

0 comments on commit c085eeb

Please sign in to comment.