Annotation Interface RegisteredOAuth2AuthorizedClient
@Target({PARAMETER,ANNOTATION_TYPE})
@Retention(RUNTIME)
@Documented
public @interface RegisteredOAuth2AuthorizedClient
This annotation may be used to resolve a method parameter to an argument value of type
OAuth2AuthorizedClient
.
For example:
@Controller public class MyController { @GetMapping("/authorized-client") public String authorizedClient(@RegisteredOAuth2AuthorizedClient("login-client") OAuth2AuthorizedClient authorizedClient) { // do something with authorizedClient } }
- Since:
- 5.1
- See Also:
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionSets the client registration identifier.The default attribute for this annotation.
-
Element Details
-
registrationId
Sets the client registration identifier.- Returns:
- the client registration identifier
- Default:
- ""
-
value
The default attribute for this annotation. This is an alias forregistrationId()
. For example,@RegisteredOAuth2AuthorizedClient("login-client")
is equivalent to@RegisteredOAuth2AuthorizedClient(registrationId="login-client")
.- Returns:
- the client registration identifier
- Default:
- ""
-