Annotation Type 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:
    OAuth2AuthorizedClientArgumentResolver
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String registrationId
      Sets the client registration identifier.
      java.lang.String value
      The default attribute for this annotation.
    • Element Detail

      • registrationId

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

        @AliasFor("registrationId")
        java.lang.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:
        ""