io.vertx.reactivex.ext.web.handler

## Class OAuth2AuthHandler

- java.lang.Object
- - io.vertx.reactivex.ext.web.handler.OAuth2AuthHandler

- All Implemented Interfaces:
    Handler<RoutingContext>, AuthenticationHandler

      public class OAuth2AuthHandler
      extends Object
      implements AuthenticationHandler, Handler<RoutingContext>

  An auth handler that provides OAuth2 Authentication support. This handler is suitable for AuthCode flows.

  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 and Description
    --- | ---
    `static io.vertx.lang.rx.TypeArg<OAuth2AuthHandler>` | `__TYPE_ARG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OAuth2AuthHandler(OAuth2AuthHandler delegate)`
    `OAuth2AuthHandler(Object delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `authenticateHeader(RoutingContext context)` Returns
    `static OAuth2AuthHandler` | `create(Vertx vertx, OAuth2Auth authProvider)` Create a OAuth2 auth handler without host pinning.
    `static OAuth2AuthHandler` | `create(Vertx vertx, OAuth2Auth authProvider, String callbackURL)` Create a OAuth2 auth handler with host pinning
    `boolean` | `equals(Object o)`
    `OAuth2AuthHandler` | `extraParams(JsonObject extraParams)` Extra parameters needed to be passed while requesting a token.
    `OAuth2AuthHandler` | `getDelegate()`
    `void` | `handle(RoutingContext event)` Something has happened, so handle it.
    `int` | `hashCode()`
    `static OAuth2AuthHandler` | `newInstance(OAuth2AuthHandler arg)`
    `void` | `parseCredentials(RoutingContext context)` Parses the credentials from the request into a JsonObject.
    `void` | `parseCredentials(RoutingContext context, Handler<AsyncResult<Credentials>> handler)` Parses the credentials from the request into a JsonObject.
    `OAuth2AuthHandler` | `pkceVerifierLength(int length)` PKCE (RFC 7636) is an extension to the Authorization Code flow to prevent several attacks and to be able to securely perform the OAuth exchange from public clients.
    `OAuth2AuthHandler` | `prompt(String prompt)` Indicates the type of user interaction that is required.
    `Single<Credentials>` | `rxParseCredentials(RoutingContext context)` Parses the credentials from the request into a JsonObject.
    `OAuth2AuthHandler` | `setupCallback(Route route)` add the callback handler to a given route.
    `String` | `toString()`
    `OAuth2AuthHandler` | `withScope(String scope)` scopes to be requested while requesting a token.

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

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

    - ### Methods inherited from interface io.vertx.reactivex.ext.web.handler.AuthenticationHandler

      `newInstance`

- - ### Field Detail

    - #### __TYPE_ARG

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

  - ### Constructor Detail

    - #### OAuth2AuthHandler

          public OAuth2AuthHandler(OAuth2AuthHandler delegate)

    - #### OAuth2AuthHandler

          public OAuth2AuthHandler(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 OAuth2AuthHandler getDelegate()

      Specified by:
        `getDelegate` in interface `AuthenticationHandler`

    - #### handle

          public void handle(RoutingContext event)

      Something has happened, so handle it.
      Specified by:
        `handle` in interface `Handler<RoutingContext>`
      Specified by:
        `handle` in interface `AuthenticationHandler`
      Parameters:
        `event` - the event to handle

    - #### parseCredentials

          public void parseCredentials(RoutingContext context,
                                       Handler<AsyncResult<Credentials>> handler)

      Parses the credentials from the request into a JsonObject. The implementation should be able to extract the required info for the auth provider in the format the provider expects.
      Specified by:
        `parseCredentials` in interface `AuthenticationHandler`
      Parameters:
        `context` - the routing context
        `handler` - the handler to be called once the information is available.

    - #### parseCredentials

          public void parseCredentials(RoutingContext context)

      Parses the credentials from the request into a JsonObject. The implementation should be able to extract the required info for the auth provider in the format the provider expects.
      Specified by:
        `parseCredentials` in interface `AuthenticationHandler`
      Parameters:
        `context` - the routing context

    - #### rxParseCredentials

          public Single<Credentials> rxParseCredentials(RoutingContext context)

      Parses the credentials from the request into a JsonObject. The implementation should be able to extract the required info for the auth provider in the format the provider expects.
      Specified by:
        `rxParseCredentials` in interface `AuthenticationHandler`
      Parameters:
        `context` - the routing context
      Returns:

    - #### authenticateHeader

          public String authenticateHeader(RoutingContext context)

      Returns
      Specified by:
        `authenticateHeader` in interface `AuthenticationHandler`
      Parameters:
        `context` -
      Returns:

    - #### create

          public static OAuth2AuthHandler create(Vertx vertx,
                                                 OAuth2Auth authProvider,
                                                 String callbackURL)

      Create a OAuth2 auth handler with host pinning
      Parameters:
        `vertx` - the vertx instance
        `authProvider` - the auth provider to use
        `callbackURL` - the callback URL you entered in your provider admin console, usually it should be something like: `https://myserver:8888/callback`
      Returns:
        the auth handler

    - #### create

          public static OAuth2AuthHandler create(Vertx vertx,
                                                 OAuth2Auth authProvider)

      Create a OAuth2 auth handler without host pinning. Most providers will not look to the redirect url but always redirect to the preconfigured callback. So this factory does not provide a callback url.
      Parameters:
        `vertx` - the vertx instance
        `authProvider` - the auth provider to use
      Returns:
        the auth handler

    - #### extraParams

          public OAuth2AuthHandler extraParams(JsonObject extraParams)

      Extra parameters needed to be passed while requesting a token.
      Parameters:
        `extraParams` - extra optional parameters.
      Returns:
        self

    - #### withScope

          public OAuth2AuthHandler withScope(String scope)

      scopes to be requested while requesting a token.
      Parameters:
        `scope` - scope.
      Returns:
        self

    - #### prompt

          public OAuth2AuthHandler prompt(String prompt)

      Indicates the type of user interaction that is required. Not all providers support this or the full list. Well known values are:
      - login will force the user to enter their credentials on that request, negating single-sign on.
      - none is the opposite - it will ensure that the user isn't presented with any interactive prompt whatsoever. If the request can't be completed silently via single-sign on, the Microsoft identity platform endpoint will return an interaction_required error.
      - consent will trigger the OAuth consent dialog after the user signs in, asking the user to grant permissions to the app.
      - select_account will interrupt single sign-on providing account selection experience listing all the accounts either in session or any remembered account or an option to choose to use a different account altogether.
      Parameters:
        `prompt` - the prompt choice.
      Returns:
        self

    - #### pkceVerifierLength

          public OAuth2AuthHandler pkceVerifierLength(int length)

      PKCE (RFC 7636) is an extension to the Authorization Code flow to prevent several attacks and to be able to securely perform the OAuth exchange from public clients. It was originally designed to protect mobile apps, but its ability to prevent authorization code injection makes it useful for every OAuth client, even web apps that use a client secret.
      Parameters:
        `length` - A number between 43 and 128. Or -1 to disable.
      Returns:
        self

    - #### setupCallback

          public OAuth2AuthHandler setupCallback(Route route)

      add the callback handler to a given route.
      Parameters:
        `route` - a given route e.g.: `/callback`
      Returns:
        self

    - #### newInstance

          public static OAuth2AuthHandler newInstance(OAuth2AuthHandler arg)

Copyright © 2020 Eclipse. All rights reserved.