Class List Method List File List

# Class: VertxAuthOauth2::GoogleAuth

Inherits:
  OpenIDConnectAuth
  - Object
  - OpenIDConnectAuth
  - VertxAuthOauth2::GoogleAuth
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb

## Overview

Simplified factory to create an OAuth2Auth for Google.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxAuthOauth2::OAuth2Auth) create(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil)
  Create a OAuth2Auth provider for Google.
- + (void) discover(vertx = nil, config = nil) { ... }
  Create a OAuth2Auth provider for OpenID Connect Discovery.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    21
    22
    23
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb', line 21

    def @@j_api_type.accept?(obj)
      obj.class == GoogleAuth
    end

### + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, serviceAccountJson) + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, clientId, clientSecret) + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, serviceAccountJson, httpClientOptions) + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, clientId, clientSecret, httpClientOptions)

Create a OAuth2Auth provider for Google

Overloads:

- + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, serviceAccountJson)

  Parameters:

  - vertx (`::Vertx::Vertx`)
  - serviceAccountJson (`Hash{String => Object}`) —
    the configuration json file from your Google API page
- + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, clientId, clientSecret)

  Parameters:

  - vertx (`::Vertx::Vertx`)
  - clientId (`String`) —
    the client id given to you by Google
  - clientSecret (`String`) —
    the client secret given to you by Google
- + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, serviceAccountJson, httpClientOptions)

  Parameters:

  - vertx (`::Vertx::Vertx`)
  - serviceAccountJson (`Hash{String => Object}`) —
    the configuration json file from your Google API page
  - httpClientOptions (`Hash`) —
    custom http client options
- + (`::VertxAuthOauth2::OAuth2Auth`) create(vertx, clientId, clientSecret, httpClientOptions)

  Parameters:

  - vertx (`::Vertx::Vertx`)
  - clientId (`String`) —
    the client id given to you by Google
  - clientSecret (`String`) —
    the client secret given to you by Google
  - httpClientOptions (`Hash`) —
    custom http client options

Returns:

- (`::VertxAuthOauth2::OAuth2Auth`)

Raises:

- (`ArgumentError`)

    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb', line 54

    def self.create(param_1=nil,param_2=nil,param_3=nil,param_4=nil)
      if param_1.class.method_defined?(:j_del) && param_2.class == Hash && !block_given? && param_3 == nil && param_4 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthOauth2Providers::GoogleAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(param_1.j_del,::Vertx::Util::Utils.to_json_object(param_2)),::VertxAuthOauth2::OAuth2Auth)
      elsif param_1.class.method_defined?(:j_del) && param_2.class == String && param_3.class == String && !block_given? && param_4 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthOauth2Providers::GoogleAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1.j_del,param_2,param_3),::VertxAuthOauth2::OAuth2Auth)
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && param_3.class == Hash && !block_given? && param_4 == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthOauth2Providers::GoogleAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreHttp::HttpClientOptions.java_class]).call(param_1.j_del,::Vertx::Util::Utils.to_json_object(param_2),Java::IoVertxCoreHttp::HttpClientOptions.new(::Vertx::Util::Utils.to_json_object(param_3))),::VertxAuthOauth2::OAuth2Auth)
      elsif param_1.class.method_defined?(:j_del) && param_2.class == String && param_3.class == String && param_4.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthOauth2Providers::GoogleAuth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreHttp::HttpClientOptions.java_class]).call(param_1.j_del,param_2,param_3,Java::IoVertxCoreHttp::HttpClientOptions.new(::Vertx::Util::Utils.to_json_object(param_4))),::VertxAuthOauth2::OAuth2Auth)
      end
      raise ArgumentError, "Invalid arguments when calling create(#{param_1},#{param_2},#{param_3},#{param_4})"
    end

### + (`void`) discover(vertx = nil, config = nil) { ... }

This method returns an undefined value.

Create a OAuth2Auth provider for OpenID Connect Discovery. The discovery will use the default site in the configuration options and attempt to load the well known descriptor. If a site is provided (for example when running on a custom instance) that site will be used to do the lookup.

If the discovered config includes a json web key url, it will be also fetched and the JWKs will be loaded into the OAuth provider so tokens can be decoded.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the vertx instance
- config (`Hash`) (defaults to: `nil`) —
  the initial config

Yields:

- the instantiated Oauth2 provider instance handler

Raises:

- (`ArgumentError`)

    76
    77
    78
    79
    80
    81
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb', line 76

    def self.discover(vertx=nil,config=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && block_given?
        return Java::IoVertxExtAuthOauth2Providers::GoogleAuth.java_method(:discover, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtAuthOauth2::OAuth2ClientOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(vertx.j_del,Java::IoVertxExtAuthOauth2::OAuth2ClientOptions.new(::Vertx::Util::Utils.to_json_object(config)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxAuthOauth2::OAuth2Auth) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling discover(#{vertx},#{config})"
    end

### + (`Object`) j_api_type

    30
    31
    32
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb', line 30

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    33
    34
    35
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb', line 33

    def self.j_class
      Java::IoVertxExtAuthOauth2Providers::GoogleAuth.java_class
    end

### + (`Object`) unwrap(obj)

    27
    28
    29
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb', line 27

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    24
    25
    26
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-auth-oauth2/google_auth.rb', line 24

    def @@j_api_type.wrap(obj)
      GoogleAuth.new(obj)
    end