public class AuthenticationSpecificationImpl extends Object implements AuthenticationSpecification, groovy.lang.GroovyObject
Constructor and Description |
---|
AuthenticationSpecificationImpl(RequestSpecification requestSpecification) |
Modifier and Type | Method and Description |
---|---|
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 |
certificate(String certURL,
String password,
CertificateAuthSettings settings)
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 |
ntlm(String userName,
String password,
String workstation,
String domain)
Use NTLM authentication.
|
RequestSpecification |
oauth(String consumerKey,
String consumerSecret,
String accessToken,
String secretToken)
Excerpt from the HttpBuilder docs:
OAuth sign the request. |
RequestSpecification |
oauth(String consumerKey,
String consumerSecret,
String accessToken,
String secretToken,
OAuthSignature signature)
Excerpt from the HttpBuilder docs:
OAuth sign the request. |
RequestSpecification |
oauth2(String accessToken)
OAuth2 sign the request.
|
RequestSpecification |
oauth2(String accessToken,
OAuthSignature signature)
OAuth2 sign the request.
|
PreemptiveAuthSpec |
preemptive()
Returns the preemptive authentication view.
|
void |
setMetaClass(groovy.lang.MetaClass mc) |
void |
setProperty(String property,
Object value) |
public AuthenticationSpecificationImpl(RequestSpecification requestSpecification)
public RequestSpecification basic(String userName, String password)
AuthenticationSpecification
basic
in interface AuthenticationSpecification
userName
- The user name.password
- The password.public RequestSpecification ntlm(String userName, String password, String workstation, String domain)
AuthenticationSpecification
ntlm
in interface AuthenticationSpecification
userName
- The user name.password
- The password.public RequestSpecification digest(String userName, String password)
AuthenticationSpecification
digest
in interface AuthenticationSpecification
userName
- The user name.password
- The password.public RequestSpecification certificate(String certURL, String password)
AuthenticationSpecification
Class.getResource(String)
for how to get a URL from a resource on the classpath.
Uses keystore: KeyStore.getDefaultType()
.
Uses port: 443
Uses keystore provider: none
certificate
in interface AuthenticationSpecification
certURL
- URL to a JKS keystore where the certificate is stored.password
- password to decrypt the keystorepublic RequestSpecification certificate(String certURL, String password, CertificateAuthSettings settings)
AuthenticationSpecification
Class.getResource(String)
for how to get a URL from a resource
on the classpath.
certificate
in interface AuthenticationSpecification
certURL
- URL to a JKS keystore where the certificate is stored.password
- The password for the keystoresettings
- More advanced settings for the certificate authenticationpublic RequestSpecification oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken)
AuthenticationSpecification
oauth
in interface AuthenticationSpecification
public RequestSpecification oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken, OAuthSignature signature)
AuthenticationSpecification
oauth
in interface AuthenticationSpecification
public RequestSpecification oauth2(String accessToken)
AuthenticationSpecification
oauth2
in interface AuthenticationSpecification
accessToken
- The access tokenpublic RequestSpecification oauth2(String accessToken, OAuthSignature signature)
AuthenticationSpecification
oauth2
in interface AuthenticationSpecification
accessToken
- The access tokensignature
- The signature (note that if using OAuthSignature.QUERY_STRING
then Scribe
must be added to the classpath)public RequestSpecification none()
AuthenticationSpecification
none
in interface AuthenticationSpecification
public PreemptiveAuthSpec preemptive()
AuthenticationSpecification
preemptive
in interface AuthenticationSpecification
public RequestSpecification form(String userName, String password)
AuthenticationSpecification
form
in interface AuthenticationSpecification
userName
- The user name.password
- The password.public RequestSpecification form(String userName, String password, FormAuthConfig config)
AuthenticationSpecification
form
in interface AuthenticationSpecification
userName
- The user name.password
- The password.config
- The form authentication configpublic groovy.lang.MetaClass getMetaClass()
getMetaClass
in interface groovy.lang.GroovyObject
public void setMetaClass(groovy.lang.MetaClass mc)
setMetaClass
in interface groovy.lang.GroovyObject
public Object invokeMethod(String method, Object arguments)
invokeMethod
in interface groovy.lang.GroovyObject
public Object getProperty(String property)
getProperty
in interface groovy.lang.GroovyObject
Copyright © 2010–2019. All rights reserved.