com.jayway.restassured.authentication
Class FormAuthConfig
java.lang.Object
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 formuserNameInputTagName - The name of the username input tag in the login formpasswordInputTagName - The name of the password input tag in the login form
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-2012. All Rights Reserved.