Package io.vertx.reactivex.ext.auth.oauth2.authorization

## Class ScopeAuthorization

- java.lang.Object
- - io.vertx.reactivex.ext.auth.oauth2.authorization.ScopeAuthorization

- All Implemented Interfaces:
    `io.vertx.lang.rx.RxDelegate`, `AuthorizationProvider`

      public class ScopeAuthorization
      extends Object
      implements io.vertx.lang.rx.RxDelegate, AuthorizationProvider

  Scope is a mechanism in OAuth 2.0 to limit an application's access to a user's account. An application can request one or more scopes, this information is then presented to the user in the consent screen, and the access token issued to the application will be limited to the scopes granted.

  The OAuth spec allows the authorization server or user to modify the scopes granted to the application compared to what is requested, although there are not many examples of services doing this in practice.

  OAuth2 does not define any particular values for scopes, since it is highly dependent on the service's internal architecture and needs.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static io.vertx.lang.rx.TypeArg<ScopeAuthorization>` | `__TYPE_ARG` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ScopeAuthorization​(ScopeAuthorization delegate)` |
    `ScopeAuthorization​(Object delegate)` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `String` | `claimKey()` | Returns the configured claim key.
    `static ScopeAuthorization` | `create()` | Factory method to create a Authorization provider for Oauth 2.0 scopes using the default separator `" "`.
    `static ScopeAuthorization` | `create​(String scopeSeparator)` | Factory method to create a Authorization provider for Oauth 2.0 scopes.
    `static ScopeAuthorization` | `create​(String scopeSeparator, String claimKey)` | Factory method to create a Authorization provider for OpenID Connect scopes.
    `String` | `encode​(List<String> scopes)` | Returns a String with the given scopes concatenated with the given separator.
    `boolean` | `equals​(Object o)` |
    `Future<Void>` | `getAuthorizations​(User user)` | Updates the user with the set of authorizations.
    `ScopeAuthorization` | `getDelegate()` |
    `String` | `getId()` | returns the id of the authorization provider
    `int` | `hashCode()` |
    `static ScopeAuthorization` | `newInstance​(ScopeAuthorization arg)` |
    `Completable` | `rxGetAuthorizations​(User user)` | Updates the user with the set of authorizations.
    `String` | `separator()` | Returns the configured separator.
    `String` | `toString()` |

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### __TYPE_ARG

          public static final io.vertx.lang.rx.TypeArg<ScopeAuthorization> __TYPE_ARG

  - ### Constructor Detail

    - #### ScopeAuthorization

          public ScopeAuthorization​(ScopeAuthorization delegate)

    - #### ScopeAuthorization

          public ScopeAuthorization​(Object delegate)

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals​(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getDelegate

          public ScopeAuthorization getDelegate()

      Specified by:
        `getDelegate` in interface `AuthorizationProvider`
      Specified by:
        `getDelegate` in interface `io.vertx.lang.rx.RxDelegate`

    - #### getId

          public String getId()

      returns the id of the authorization provider
      Specified by:
        `getId` in interface `AuthorizationProvider`
      Returns:

    - #### getAuthorizations

          public Future<Void> getAuthorizations​(User user)

      Updates the user with the set of authorizations.
      Specified by:
        `getAuthorizations` in interface `AuthorizationProvider`
      Parameters:
        `user` - user to lookup and update.
      Returns:
        Future void to signal end of asynchronous call.

    - #### rxGetAuthorizations

          public Completable rxGetAuthorizations​(User user)

      Updates the user with the set of authorizations.
      Specified by:
        `rxGetAuthorizations` in interface `AuthorizationProvider`
      Parameters:
        `user` - user to lookup and update.
      Returns:
        Future void to signal end of asynchronous call.

    - #### create

          public static ScopeAuthorization create()

      Factory method to create a Authorization provider for Oauth 2.0 scopes using the default separator `" "`.
      Returns:
        a AuthorizationProvider

    - #### create

          public static ScopeAuthorization create​(String scopeSeparator)

      Factory method to create a Authorization provider for Oauth 2.0 scopes.
      Parameters:
        `scopeSeparator` - the scope separator e.g.: `" "`, `","`, `"+"`
      Returns:
        a AuthorizationProvider

    - #### create

          public static ScopeAuthorization create​(String scopeSeparator,
                                                  String claimKey)

      Factory method to create a Authorization provider for OpenID Connect scopes. The claim key will be used to locate the scopes from a decoded JWT.
      Parameters:
        `scopeSeparator` - the scope separator e.g.: `" "`, `","`, `"+"`
        `claimKey` - the scope claim key e.g.: `"scp"`, `"scope"`
      Returns:
        a AuthorizationProvider

    - #### separator

          public String separator()

      Returns the configured separator.
      Returns:
        the separator.

    - #### claimKey

          public String claimKey()

      Returns the configured claim key.
      Returns:
        the claim key.

    - #### encode

          public String encode​(List<String> scopes)

      Returns a String with the given scopes concatenated with the given separator.
      Parameters:
        `scopes` - a list of scopes
      Returns:
        concatenated string.

    - #### newInstance

          public static ScopeAuthorization newInstance​(ScopeAuthorization arg)