vertx-lang-scala-docs_2.12 3.4.0 API < Back
 

# Packages

-  package root
  Definition Classes
    root
-  package io
  Definition Classes
    root
-  package vertx
  Definition Classes
    io
-  package scala
  Definition Classes
    vertx
-  package ext
  Definition Classes
    scala
-  package auth
  Definition Classes
    ext
-  package oauth2
  Definition Classes
    auth
-  package providers
  Definition Classes
    oauth2
- AccessToken
- KeycloakHelper
- OAuth2Auth
- OAuth2ClientOptions

c

io.vertx.scala.ext.auth.oauth2

# OAuth2Auth 

###
Companion object OAuth2Auth

#### class OAuth2Auth extends AuthProvider

Factory interface for creating OAuth2 based io.vertx.scala.ext.auth.AuthProvider instances.

Linear Supertypes
AuthProvider, AnyRef, Any
 
Ordering

1. Alphabetic
2. By Inheritance

Inherited

1. OAuth2Auth
2. AuthProvider
3. AnyRef
4. Any

1. Hide All
2. Show All

Visibility

1. Public
2. All

### Instance Constructors

1.  new OAuth2Auth(_asJava: AnyRef)

### Value Members

1.  final def !=(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
2.  final def ##(): Int
   Definition Classes
     AnyRef → Any
3.  final def ==(arg0: Any): Boolean
   Definition Classes
     AnyRef → Any
4.  def api(method: HttpMethod, path: String, params: JsonObject, handler: Handler[AsyncResult[JsonObject]]): OAuth2Auth

   Call OAuth2 APIs.

   Call OAuth2 APIs.

   method

     HttpMethod

   path

     target path

   params

     parameters

   handler

     handler

   returns

     self

5.  def apiFuture(method: HttpMethod, path: String, params: JsonObject): Future[JsonObject]

   Like api but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

6.  final def asInstanceOf[T0]: T0
   Definition Classes
     Any
7.  def asJava: AnyRef
   Definition Classes
     AuthProvider
8.  def authenticate(authInfo: JsonObject, resultHandler: Handler[AsyncResult[User]]): Unit

   Authenticate a user.

   Authenticate a user.

   The first argument is a JSON object containing information for authenticating the user. What this actually contains depends on the specific implementation. In the case of a simple username/password based authentication it is likely to contain a JSON object with the following structure:

         {
           "username": "tim",
           "password": "mypassword"
         `

   For other types of authentication it contain different information - for example a JWT token or OAuth bearer token.

   If the user is successfully authenticated a io.vertx.scala.ext.auth.User object is passed to the handler in an io.vertx.scala.core.AsyncResult. The user object can then be used for authorisation.

   authInfo

     The auth information

   resultHandler

     The result handler

   Definition Classes
     AuthProvider
9.  def authenticateFuture(authInfo: JsonObject): Future[User]

   Like authenticate but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

   Like authenticate but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

   Definition Classes
     AuthProvider
10.  def authorizeURL(params: JsonObject): String

    Generate a redirect URL to the authN/Z backend.

    Generate a redirect URL to the authN/Z backend. It only applies to auth_code flow.

11.  def clone(): AnyRef
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
12.  def decodeToken(token: String, handler: Handler[AsyncResult[AccessToken]]): OAuth2Auth

    Decode a token to a io.vertx.scala.ext.auth.oauth2.AccessToken object.

    Decode a token to a io.vertx.scala.ext.auth.oauth2.AccessToken object. This is useful to handle bearer JWT tokens.

    token

      the access token (base64 string)

    handler

      A handler to receive the event

    returns

      self

13.  def decodeTokenFuture(token: String): Future[AccessToken]

    Like decodeToken but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

14.  final def eq(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
15.  def equals(arg0: Any): Boolean
    Definition Classes
      AnyRef → Any
16.  def finalize(): Unit
    Attributes
      protected[java.lang]
    Definition Classes
      AnyRef
    Annotations
      @throws( classOf[java.lang.Throwable] )
17.  final def getClass(): Class[_]
    Definition Classes
      AnyRef → Any
18.  def getScopeSeparator(): String

    Returns the scope separator.

    Returns the scope separator.

    The RFC 6749 states that a scope is expressed as a set of case-sensitive and space-delimited strings, however vendors tend not to agree on this and we see the following cases being used: space, plus sign, comma.

    returns

      what value was used in the configuration of the object, falling back to the default value which is a space.

19.  def getToken(params: JsonObject, handler: Handler[AsyncResult[AccessToken]]): Unit

    Returns the Access Token object.

    Returns the Access Token object.

    params

      - JSON with the options, each flow requires different options.

    handler

      - The handler returning the results.

20.  def getTokenFuture(params: JsonObject): Future[AccessToken]

    Like getToken but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

21.  def hasJWTToken(): Boolean

    Returns true if this provider supports JWT tokens as the access_token.

    Returns true if this provider supports JWT tokens as the access_token. This is typically true if the provider implements the `openid-connect` protocol. This is a plain return from the config option jwtToken, which is false by default.

    This information is important to validate grants. Since pure OAuth2 should be used for authorization and when a token is requested all grants should be declared, in case of openid-connect this is not true. OpenId will issue a token and all grants will be encoded on the token itself so the requester does not need to list the required grants.

    returns

      true if openid-connect is used.

22.  def hashCode(): Int
    Definition Classes
      AnyRef → Any
23.  def introspectToken(token: String, tokenType: String, handler: Handler[AsyncResult[JsonObject]]): OAuth2Auth

    Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.

    Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.

    token

      the access token (base64 string)

    tokenType

      hint to the token type e.g.: `access_token`

    handler

      A handler to receive the event

    returns

      self

24.  def introspectToken(token: String, handler: Handler[AsyncResult[AccessToken]]): OAuth2Auth

    Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.

    Query an OAuth 2.0 authorization server to determine the active state of an OAuth 2.0 token and to determine meta-information about this token.

    token

      the access token (base64 string)

    handler

      A handler to receive the event

    returns

      self

25.  def introspectTokenFuture(token: String, tokenType: String): Future[JsonObject]

    Like introspectToken but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

26.  def introspectTokenFuture(token: String): Future[AccessToken]

    Like introspectToken but returns a scala.concurrent.Future instead of taking an AsyncResultHandler.

27.  final def isInstanceOf[T0]: Boolean
    Definition Classes
      Any
28.  final def ne(arg0: AnyRef): Boolean
    Definition Classes
      AnyRef
29.  final def notify(): Unit
    Definition Classes
      AnyRef
30.  final def notifyAll(): Unit
    Definition Classes
      AnyRef
31.  final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
      AnyRef
32.  def toString(): String
    Definition Classes
      AnyRef → Any
33.  final def wait(): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
34.  final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )
35.  final def wait(arg0: Long): Unit
    Definition Classes
      AnyRef
    Annotations
      @throws( ... )

### Inherited from AuthProvider

### Inherited from AnyRef

### Inherited from Any

### Ungrouped