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

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Sets the client registration identifier.
    The default attribute for this annotation.
  • Element Details

    • registrationId

      @AliasFor("value") String registrationId
      Sets the client registration identifier.
      Returns:
      the client registration identifier
      Default:
      ""
    • value

      @AliasFor("registrationId") String value
      The default attribute for this annotation. This is an alias for registrationId(). For example, @RegisteredOAuth2AuthorizedClient("login-client") is equivalent to @RegisteredOAuth2AuthorizedClient(registrationId="login-client").
      Returns:
      the client registration identifier
      Default:
      ""