com.jayway.restassured.authentication
Class FormAuthConfig

java.lang.Object
  extended by com.jayway.restassured.authentication.FormAuthConfig

public class FormAuthConfig
extends Object

Configuration of form authentication to correctly identify which form that contains the username and password and the action of the form.


Constructor Summary
FormAuthConfig(String formAction, String userNameInputTagName, String passwordInputTagName)
          Create a form auth config with a pre-defined form action, username input tag, password input tag.
 
Method Summary
 String getFormAction()
           
 String getPasswordInputTagName()
           
 String getUserInputTagName()
           
static FormAuthConfig springSecurity()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormAuthConfig

public FormAuthConfig(String formAction,
                      String userNameInputTagName,
                      String passwordInputTagName)
Create a form auth config with a pre-defined form action, username input tag, password input tag. E.g. let's say that the login form on your login page looks like this:
  <form action="/j_spring_security_check">
     <label for="j_username">Username</label>
     <input type="text" name="j_username" id="j_username"/>
     <br/>
     <label for="j_password">Password</label>
     <input type="password" name="j_password" id="j_password"/>
     <br/>
     <input type='checkbox' name='_spring_security_remember_me'/> Remember me on this computer.
     <br/>
     <input type="submit" value="Login"/>
 </form>
 
This means that formAction should be set to /j_spring_security_check, userNameInputTagName should be set to j_username and passwordInputTagName should be set to j_password.

Parameters:
formAction - The action of the form
userNameInputTagName - The name of the username input tag in the login form
passwordInputTagName - The name of the password input tag in the login form
Method Detail

springSecurity

public static FormAuthConfig springSecurity()
Returns:
A predefined form authentication config for default Spring Security configuration (tested in version 3.0.5).

getFormAction

public String getFormAction()

getUserInputTagName

public String getUserInputTagName()

getPasswordInputTagName

public String getPasswordInputTagName()


Copyright © 2010-2011. All Rights Reserved.