Class List Method List File List

# Class: VertxAuthOauth2::OAuth2Auth

Inherits:
  VertxAuthCommon::AuthProvider
  - Object
  - VertxAuthCommon::AuthProvider
  - VertxAuthOauth2::OAuth2Auth
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb

## Class Method Summary (collapse)

- + (Object) create(vertx = nil, flow = nil, config = nil)
- + (Object) create_keycloak(vertx = nil, flow = nil, config = nil)

## Instance Method Summary (collapse)

- - (Object) api(method = nil, path = nil, params = nil)
- - (Object) authenticate(arg0 = nil)
- - (Object) authorize_url(params = nil)
- - (Object) get_token(params = nil)
- - (Boolean) has_jwt_token?
- - (OAuth2Auth) initialize(j_del) constructor
  A new instance of OAuth2Auth.
- - (Object) j_del

## Constructor Details

### - (`OAuth2Auth`) initialize(j_del)

Returns a new instance of OAuth2Auth

    12
    13
    14
    15
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 12

    def initialize(j_del)
      super(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(vertx = nil, flow = nil, config = nil)

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    52
    53
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 46

    def self.create(vertx=nil,flow=nil,config=nil)
      if vertx.class.method_defined?(:j_del) && flow.class == Symbol && !block_given? && config == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthOauth2::OAuth2Auth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtAuthOauth2::OAuth2FlowType.java_class]).call(vertx.j_del,Java::IoVertxExtAuthOauth2::OAuth2FlowType.valueOf(flow)),::VertxAuthOauth2::OAuth2Auth)
      elsif vertx.class.method_defined?(:j_del) && flow.class == Symbol && config.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthOauth2::OAuth2Auth.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtAuthOauth2::OAuth2FlowType.java_class,Java::IoVertxExtAuthOauth2::OAuth2ClientOptions.java_class]).call(vertx.j_del,Java::IoVertxExtAuthOauth2::OAuth2FlowType.valueOf(flow),Java::IoVertxExtAuthOauth2::OAuth2ClientOptions.new(::Vertx::Util::Utils.to_json_object(config))),::VertxAuthOauth2::OAuth2Auth)
      end
      raise ArgumentError, "Invalid arguments when calling create(vertx,flow,config)"
    end

### + (`Object`) create_keycloak(vertx = nil, flow = nil, config = nil)

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 35

    def self.create_keycloak(vertx=nil,flow=nil,config=nil)
      if vertx.class.method_defined?(:j_del) && flow.class == Symbol && config.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAuthOauth2::OAuth2Auth.java_method(:createKeycloak, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxExtAuthOauth2::OAuth2FlowType.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,Java::IoVertxExtAuthOauth2::OAuth2FlowType.valueOf(flow),::Vertx::Util::Utils.to_json_object(config)),::VertxAuthOauth2::OAuth2Auth)
      end
      raise ArgumentError, "Invalid arguments when calling create_keycloak(vertx,flow,config)"
    end

## Instance Method Details

### - (`Object`) api(method = nil, path = nil, params = nil)

Raises:

- (`ArgumentError`)

    79
    80
    81
    82
    83
    84
    85
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 79

    def api(method=nil,path=nil,params=nil)
      if method.class == Symbol && path.class == String && params.class == Hash && block_given?
        @j_del.java_method(:api, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(method),path,::Vertx::Util::Utils.to_json_object(params),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.encode) : nil : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling api(method,path,params)"
    end

### - (`Object`) authenticate(arg0 = nil)

Raises:

- (`ArgumentError`)

    24
    25
    26
    27
    28
    29
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 24

    def authenticate(arg0=nil)
      if arg0.class == Hash && block_given?
        return @j_del.java_method(:authenticate, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(arg0),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxAuthCommon::User) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling authenticate(arg0)"
    end

### - (`Object`) authorize_url(params = nil)

Raises:

- (`ArgumentError`)

    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 57

    def authorize_url(params=nil)
      if params.class == Hash && !block_given?
        return @j_del.java_method(:authorizeURL, [Java::IoVertxCoreJson::JsonObject.java_class]).call(::Vertx::Util::Utils.to_json_object(params))
      end
      raise ArgumentError, "Invalid arguments when calling authorize_url(params)"
    end

### - (`Object`) get_token(params = nil)

Raises:

- (`ArgumentError`)

    67
    68
    69
    70
    71
    72
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 67

    def get_token(params=nil)
      if params.class == Hash && block_given?
        return @j_del.java_method(:getToken, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(params),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxAuthOauth2::AccessToken) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_token(params)"
    end

### - (`Boolean`) has_jwt_token?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    95
    96
    97
    98
    99
    100
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 95

    def has_jwt_token?
      if !block_given?
        return @j_del.java_method(:hasJWTToken, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling has_jwt_token?()"
    end

### - (`Object`) j_del

    18
    19
    20
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-auth-oauth2/o_auth2_auth.rb', line 18

    def j_del
      @j_del
    end