Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor JWT quickstart doc updates #45530

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sberyozkin,

It looks like you’re considering moving the command to a separate code block under this heading or possibly combining these two headings. Is that the direction you’re thinking? Let me know if there’s anything I can do to assist!


Expand Down
Loading