com.jayway.restassured.internal
Class AuthenticationSpecificationImpl

java.lang.Object
  extended by com.jayway.restassured.internal.AuthenticationSpecificationImpl
All Implemented Interfaces:
AuthenticationSpecification, groovy.lang.GroovyObject

public class AuthenticationSpecificationImpl
extends Object
implements AuthenticationSpecification, groovy.lang.GroovyObject


Constructor Summary
AuthenticationSpecificationImpl(RequestSpecification requestSpecification)
           
 
Method Summary
 RequestSpecification basic(String userName, String password)
          Use http basic authentication.
 RequestSpecification certificate(String certURL, String password)
          Sets a certificate to be used for SSL authentication.
 RequestSpecification digest(String userName, String password)
          Use http digest authentication.
 RequestSpecification form(String userName, String password)
          Use form authentication.
 RequestSpecification form(String userName, String password, FormAuthConfig config)
          Use form authentication with the supplied configuration.
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String property)
           
 Object invokeMethod(String method, Object arguments)
           
 RequestSpecification none()
          Explicitly state that you don't which to use any authentication in this request.
 RequestSpecification oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken)
          Excerpt from the HttpBuilder docs:
OAuth sign the request.
 PreemptiveAuthSpec preemptive()
          Returns the preemptive authentication view.
 void setMetaClass(groovy.lang.MetaClass mc)
           
 void setProperty(String property, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationSpecificationImpl

public AuthenticationSpecificationImpl(RequestSpecification requestSpecification)
Method Detail

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject

setMetaClass

public void setMetaClass(groovy.lang.MetaClass mc)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject

invokeMethod

public Object invokeMethod(String method,
                           Object arguments)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject

getProperty

public Object getProperty(String property)
Specified by:
getProperty in interface groovy.lang.GroovyObject

setProperty

public void setProperty(String property,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject

basic

public RequestSpecification basic(String userName,
                                  String password)
Description copied from interface: AuthenticationSpecification
Use http basic authentication.

Specified by:
basic in interface AuthenticationSpecification
Parameters:
userName - The user name.
password - The password.
Returns:
The Request specification

digest

public RequestSpecification digest(String userName,
                                   String password)
Description copied from interface: AuthenticationSpecification
Use http digest authentication.

Specified by:
digest in interface AuthenticationSpecification
Parameters:
userName - The user name.
password - The password.
Returns:
The Request specification

certificate

public RequestSpecification certificate(String certURL,
                                        String password)
Description copied from interface: AuthenticationSpecification
Sets a certificate to be used for SSL authentication. See Class.getResource(String) for how to get a URL from a resource on the classpath.

Specified by:
certificate in interface AuthenticationSpecification
Parameters:
certURL - URL to a JKS keystore where the certificate is stored.
password - password to decrypt the keystore
Returns:
Request specification

oauth

public RequestSpecification oauth(String consumerKey,
                                  String consumerSecret,
                                  String accessToken,
                                  String secretToken)
Description copied from interface: AuthenticationSpecification
Excerpt from the HttpBuilder docs:
OAuth sign the request. Note that this currently does not wait for a WWW-Authenticate challenge before sending the the OAuth header. All requests to all domains will be signed for this instance. This assumes you've already generated an accessToken and secretToken for the site you're targeting. For More information on how to achieve this, see the Signpost documentation.

Specified by:
oauth in interface AuthenticationSpecification
Returns:
The request com.jayway.restassured.specification

none

public RequestSpecification none()
Description copied from interface: AuthenticationSpecification
Explicitly state that you don't which to use any authentication in this request. This is useful only in cases where you've specified a default authentication scheme and you wish to override it for a single request.

Specified by:
none in interface AuthenticationSpecification
Returns:
The Request specification

preemptive

public PreemptiveAuthSpec preemptive()
Description copied from interface: AuthenticationSpecification
Returns the preemptive authentication view. This means that the authentication details are sent in the request header regardless if the server has challenged for authentication or not.

Specified by:
preemptive in interface AuthenticationSpecification
Returns:
The preemptive authentication specification.

form

public RequestSpecification form(String userName,
                                 String password)
Description copied from interface: AuthenticationSpecification
Use form authentication. Rest Assured will try to parse the response login page and determine and try find the action, username and password input field automatically.

Specified by:
form in interface AuthenticationSpecification
Parameters:
userName - The user name.
password - The password.
Returns:
The Request specification

form

public RequestSpecification form(String userName,
                                 String password,
                                 FormAuthConfig config)
Description copied from interface: AuthenticationSpecification
Use form authentication with the supplied configuration.

Specified by:
form in interface AuthenticationSpecification
Parameters:
userName - The user name.
password - The password.
config - The form authentication config
Returns:
The authentication scheme


Copyright © 2010-2011. All Rights Reserved.