public interface AuthenticationSpecification
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 certificateAuthSettings)
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.
|
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. |
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.
|
RequestSpecification basic(String userName, String password)
userName
- The user name.password
- The password.RequestSpecification digest(String userName, String password)
userName
- The user name.password
- The password.RequestSpecification form(String userName, String password)
userName
- The user name.password
- The password.RequestSpecification form(String userName, String password, FormAuthConfig config)
userName
- The user name.password
- The password.config
- The form authentication configRequestSpecification certificate(String certURL, String password)
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
certURL
- URL to a JKS keystore where the certificate is stored.password
- password to decrypt the keystoreRequestSpecification certificate(String certURL, String password, CertificateAuthSettings certificateAuthSettings)
Class.getResource(String)
for how to get a URL from a resource
on the classpath.
certURL
- URL to a JKS keystore where the certificate is stored.password
- The password for the keystorecertificateAuthSettings
- More advanced settings for the certificate authenticationRequestSpecification oauth2(String accessToken)
accessToken
- The access tokenRequestSpecification oauth2(String accessToken, OAuthSignature signature)
accessToken
- The access tokensignature
- The signature (note that if using OAuthSignature.QUERY_STRING
then Scribe
must be added to the classpath)RequestSpecification oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken)
consumerKey
- consumerSecret
- accessToken
- secretToken
- RequestSpecification oauth(String consumerKey, String consumerSecret, String accessToken, String secretToken, OAuthSignature signature)
consumerKey
- consumerSecret
- accessToken
- secretToken
- signature
- PreemptiveAuthSpec preemptive()
RequestSpecification none()
Copyright © 2010–2017. All rights reserved.