Class List Method List File List

# Class: VertxWeb::RedirectAuthHandler

Inherits:
  Object
  - Object
  - VertxWeb::RedirectAuthHandler
  show all
Includes:
  AuthHandler
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/redirect_auth_handler.rb

## Overview

An auth handler that's used to handle auth by redirecting user to a custom login page.

## Class Method Summary (collapse)

- + (::VertxWeb::AuthHandler) create(authProvider = nil, loginRedirectURL = nil, returnURLParam = nil)
  Create a handler.

## Instance Method Summary (collapse)

- - (self) add_authorities(authorities = nil)
  Add a set of required authorities for this auth handler.
- - (self) add_authority(authority = nil)
  Add a required authority for this auth handler.
- - (void) handle(arg0 = nil)

## Class Method Details

### + (`::VertxWeb::AuthHandler`) create(authProvider = nil, loginRedirectURL = nil, returnURLParam = nil)

Create a handler

Parameters:

- authProvider (`::VertxAuthCommon::AuthProvider`) (defaults to: `nil`) —
  the auth service to use
- loginRedirectURL (`String`) (defaults to: `nil`) —
  the url to redirect the user to
- returnURLParam (`String`) (defaults to: `nil`) —
  the name of param used to store return url information in session

Returns:

- (`::VertxWeb::AuthHandler`) —
  the handler

Raises:

- (`ArgumentError`)

    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/redirect_auth_handler.rb', line 53

    def self.create(authProvider=nil,loginRedirectURL=nil,returnURLParam=nil)
      if authProvider.class.method_defined?(:j_del) && !block_given? && loginRedirectURL == nil && returnURLParam == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::RedirectAuthHandler.java_method(:create, [Java::IoVertxExtAuth::AuthProvider.java_class]).call(authProvider.j_del),::VertxWeb::AuthHandlerImpl)
      elsif authProvider.class.method_defined?(:j_del) && loginRedirectURL.class == String && !block_given? && returnURLParam == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::RedirectAuthHandler.java_method(:create, [Java::IoVertxExtAuth::AuthProvider.java_class,Java::java.lang.String.java_class]).call(authProvider.j_del,loginRedirectURL),::VertxWeb::AuthHandlerImpl)
      elsif authProvider.class.method_defined?(:j_del) && loginRedirectURL.class == String && returnURLParam.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtWebHandler::RedirectAuthHandler.java_method(:create, [Java::IoVertxExtAuth::AuthProvider.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(authProvider.j_del,loginRedirectURL,returnURLParam),::VertxWeb::AuthHandlerImpl)
      end
      raise ArgumentError, "Invalid arguments when calling create(authProvider,loginRedirectURL,returnURLParam)"
    end

## Instance Method Details

### - (`self`) add_authorities(authorities = nil)

Add a set of required authorities for this auth handler

Parameters:

- authorities (`Set<String>`) (defaults to: `nil`) —
  the set of authorities

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    41
    42
    43
    44
    45
    46
    47
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/redirect_auth_handler.rb', line 41

    def add_authorities(authorities=nil)
      if authorities.class == Set && !block_given?
        @j_del.java_method(:addAuthorities, [Java::JavaUtil::Set.java_class]).call(Java::JavaUtil::LinkedHashSet.new(authorities.map { |element| element }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling add_authorities(authorities)"
    end

### - (`self`) add_authority(authority = nil)

Add a required authority for this auth handler

Parameters:

- authority (`String`) (defaults to: `nil`) —
  the authority

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    31
    32
    33
    34
    35
    36
    37
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/redirect_auth_handler.rb', line 31

    def add_authority(authority=nil)
      if authority.class == String && !block_given?
        @j_del.java_method(:addAuthority, [Java::java.lang.String.java_class]).call(authority)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling add_authority(authority)"
    end

### - (`void`) handle(arg0 = nil)

This method returns an undefined value.

Parameters:

- arg0 (`::VertxWeb::RoutingContext`) (defaults to: `nil`)

Raises:

- (`ArgumentError`)

    22
    23
    24
    25
    26
    27
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/redirect_auth_handler.rb', line 22

    def handle(arg0=nil)
      if arg0.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:handle, [Java::IoVertxExtWeb::RoutingContext.java_class]).call(arg0.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling handle(arg0)"
    end