Class List Method List File List

# Class: VertxWeb::FormLoginHandler

Inherits:
  Object
  - Object
  - VertxWeb::FormLoginHandler
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/form_login_handler.rb

## Overview

Handler that handles login from a form on a custom login page.

Used in conjunction with the RedirectAuthHandler.

## Class Method Summary (collapse)

- + (::VertxWeb::FormLoginHandler) create(authProvider = nil, usernameParam = nil, passwordParam = nil, returnURLParam = nil, directLoggedInOKURL = nil)
  Create a handler.

## Instance Method Summary (collapse)

- - (void) handle(arg0 = nil)
- - (::VertxWeb::FormLoginHandler) set_direct_logged_in_okurl(directLoggedInOKURL = nil)
  Set the url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first.
- - (::VertxWeb::FormLoginHandler) set_password_param(passwordParam = nil)
  Set the name of the form param used to submit the password.
- - (::VertxWeb::FormLoginHandler) set_return_url_param(returnURLParam = nil)
  Set the name of the session attrioute used to specify the return url.
- - (::VertxWeb::FormLoginHandler) set_username_param(usernameParam = nil)
  Set the name of the form param used to submit the username.

## Class Method Details

### + (`::VertxWeb::FormLoginHandler`) create(authProvider = nil, usernameParam = nil, passwordParam = nil, returnURLParam = nil, directLoggedInOKURL = nil)

Create a handler

Parameters:

- authProvider (`::VertxAuthCommon::AuthProvider`) (defaults to: `nil`) —
  the auth service to use
- usernameParam (`String`) (defaults to: `nil`) —
  the value of the form attribute which will contain the username
- passwordParam (`String`) (defaults to: `nil`) —
  the value of the form attribute which will contain the password
- returnURLParam (`String`) (defaults to: `nil`) —
  the value of the session attribute which will contain the return url
- directLoggedInOKURL (`String`) (defaults to: `nil`) —
  a url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first

Returns:

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

Raises:

- (`ArgumentError`)

    35
    36
    37
    38
    39
    40
    41
    42
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/form_login_handler.rb', line 35

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

## Instance Method Details

### - (`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/form_login_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

### - (`::VertxWeb::FormLoginHandler`) set_direct_logged_in_okurl(directLoggedInOKURL = nil)

Set the url to redirect to if the user logs in directly at the url of the form login handler without being redirected here first

Parameters:

- directLoggedInOKURL (`String`) (defaults to: `nil`) —
  the URL to redirect to

Returns:

- (`::VertxWeb::FormLoginHandler`) —
  a reference to this for a fluent API

Raises:

- (`ArgumentError`)

    74
    75
    76
    77
    78
    79
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/form_login_handler.rb', line 74

    def set_direct_logged_in_okurl(directLoggedInOKURL=nil)
      if directLoggedInOKURL.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setDirectLoggedInOKURL, [Java::java.lang.String.java_class]).call(directLoggedInOKURL),::VertxWeb::FormLoginHandler)
      end
      raise ArgumentError, "Invalid arguments when calling set_direct_logged_in_okurl(directLoggedInOKURL)"
    end

### - (`::VertxWeb::FormLoginHandler`) set_password_param(passwordParam = nil)

Set the name of the form param used to submit the password

Parameters:

- passwordParam (`String`) (defaults to: `nil`) —
  the name of the param

Returns:

- (`::VertxWeb::FormLoginHandler`) —
  a reference to this for a fluent API

Raises:

- (`ArgumentError`)

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

    def set_password_param(passwordParam=nil)
      if passwordParam.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setPasswordParam, [Java::java.lang.String.java_class]).call(passwordParam),::VertxWeb::FormLoginHandler)
      end
      raise ArgumentError, "Invalid arguments when calling set_password_param(passwordParam)"
    end

### - (`::VertxWeb::FormLoginHandler`) set_return_url_param(returnURLParam = nil)

Set the name of the session attrioute used to specify the return url

Parameters:

- returnURLParam (`String`) (defaults to: `nil`) —
  the name of the param

Returns:

- (`::VertxWeb::FormLoginHandler`) —
  a reference to this for a fluent API

Raises:

- (`ArgumentError`)

    64
    65
    66
    67
    68
    69
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/form_login_handler.rb', line 64

    def set_return_url_param(returnURLParam=nil)
      if returnURLParam.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setReturnURLParam, [Java::java.lang.String.java_class]).call(returnURLParam),::VertxWeb::FormLoginHandler)
      end
      raise ArgumentError, "Invalid arguments when calling set_return_url_param(returnURLParam)"
    end

### - (`::VertxWeb::FormLoginHandler`) set_username_param(usernameParam = nil)

Set the name of the form param used to submit the username

Parameters:

- usernameParam (`String`) (defaults to: `nil`) —
  the name of the param

Returns:

- (`::VertxWeb::FormLoginHandler`) —
  a reference to this for a fluent API

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-web/vertx-web/src/main/resources/vertx-web/form_login_handler.rb', line 46

    def set_username_param(usernameParam=nil)
      if usernameParam.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:setUsernameParam, [Java::java.lang.String.java_class]).call(usernameParam),::VertxWeb::FormLoginHandler)
      end
      raise ArgumentError, "Invalid arguments when calling set_username_param(usernameParam)"
    end