Class List Method List File List

# Class: VertxWeb::FormLoginHandler

Inherits:
  Object
  - Object
  - VertxWeb::FormLoginHandler
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/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)
- - (self) 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.
- - (self) set_password_param(passwordParam = nil)
  Set the name of the form param used to submit the password.
- - (self) set_return_url_param(returnURLParam = nil)
  Set the name of the session attrioute used to specify the return url.
- - (self) 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-stack/stack-docs/target/rb/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-stack/stack-docs/target/rb/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

### - (`self`) 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:

- (`self`)

Raises:

- (`ArgumentError`)

    77
    78
    79
    80
    81
    82
    83
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 77

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

### - (`self`) 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:

- (`self`)

Raises:

- (`ArgumentError`)

    56
    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 56

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

### - (`self`) 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:

- (`self`)

Raises:

- (`ArgumentError`)

    66
    67
    68
    69
    70
    71
    72
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 66

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

### - (`self`) 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:

- (`self`)

Raises:

- (`ArgumentError`)

    46
    47
    48
    49
    50
    51
    52
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-web/form_login_handler.rb', line 46

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