Skip to content

Multi-tenancy Documentation - JwtDecoder sample has multiple errors #10505

@jmax01

Description

@jmax01

Describe the bug
The sample code for the JwtDecoder is does not compile: docs/modules/ROOT/pages/servlet/oauth2/resource-server/multitenancy.adoc#L418-L424

Details in comments:

JwtDecoder jwtDecoder(JWTProcessor jwtProcessor, OAuth2TokenValidator<Jwt> jwtValidator) {

        //FIXME: Should be jwtProcessor not processor
	NimbusJwtDecoder decoder = new NimbusJwtDecoder(processor);

        //FIXME: The jwtValidator is a method argument not an instance variable. 
	OAuth2TokenValidator<Jwt> validator = new DelegatingOAuth2TokenValidator<>
			(JwtValidators.createDefault(), this.jwtValidator);
	decoder.setJwtValidator(validator);
	return decoder;
}

To Reproduce
Try to use the sample code.

Expected behavior
Sample code should be valid

Metadata

Metadata

Assignees

Labels

in: docsAn issue in Documentation or samplesstatus: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions