spring-projects / spring-projects/spring-security

Align JWT Testing Documentation

Open
#10,028 2 comments 0 reactions 1 assignee View on GitHub

@chrylis is already working on this.

Since Jul 2, 2021.

in: docs status: ideal-for-contribution type: enhancement
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

The SecurityMockMvcRequestPostProcessors and SecurityMockServerConfigurers references contain a section for each OAuth 2.0-based request post processor or mock server configurer.

Most of them were written at the same time and so read about the same way; however, the "Testing JWT Authentication" sections read quite differently from the rest.

So that all the sections read similarly, we should update the "Testing JWT Authentication" (servlet) and "Testing JWT Authentication" (webflux) sections.

The changes should at least include:

  • The section titles should be changed from "Testing JWT Authentication" to "Testing OAuth 2.0 Resource Servers with JWT".
  • The initial paragraphs should show an example of when SecurityMockMvcRequestPostProcessors#jwt() and SecurityMockServerConfigurers#mockJwt() are necessary, respectively. For example, the documentation implies that it should be used whenever an application is configured as a resource server - it should be clearer that it's when an application's controllers need the principal to be a Jwt.

In the end, these two sections should read the same as their OAuth 2.0 counterparts like "Testing OIDC Login" (servlet), "Testing OAuth 2.0 Login" (servlet), "Testing OAuth 2.0 Clients" (webflux), and "Testing Opaque Token Authentication" (webflux).

To preserve links, all the anchors should remain as-is.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.