Skip to content

Code example in documentation is incorrect #16165

Closed
@sjohnr

Description

@sjohnr

The code example for creating a OAuth2ClientHttpRequestInterceptor is incorrect in Access Protected Resources for the Current User. The example:

OAuth2ClientHttpRequestInterceptor requestInterceptor =
		new OAuth2ClientHttpRequestInterceptor(authorizedClientManager, clientRegistrationIdResolver());
return RestClient.builder()
		.requestInterceptor(requestInterceptor)
		.build();

should instead be:

OAuth2ClientHttpRequestInterceptor requestInterceptor =
		new OAuth2ClientHttpRequestInterceptor(authorizedClientManager);
requestInterceptor.setClientRegistrationIdResolver(clientRegistrationIdResolver());

return RestClient.builder()
		.requestInterceptor(requestInterceptor)
		.build();

Metadata

Metadata

Assignees

Labels

in: docsAn issue in Documentation or samplesstatus: duplicateA duplicate of another issuetype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions