public class RestAuthenticator extends ProfileDefinitionAware<RestProfile> implements Authenticator<UsernamePasswordCredentials>
Constructor and Description |
---|
RestAuthenticator() |
RestAuthenticator(String url) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildProfile(UsernamePasswordCredentials credentials,
String body) |
protected String |
callRestApi(String username,
String password)
Return the body from the REST API, passing the username/pasword auth.
|
com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
String |
getUrl() |
protected void |
internalInit()
Internal initialization of the object.
|
void |
setMapper(com.fasterxml.jackson.databind.ObjectMapper mapper) |
void |
setUrl(String url) |
String |
toString() |
void |
validate(UsernamePasswordCredentials credentials,
WebContext context)
Validate the credentials.
|
defaultProfileDefinition, getProfileDefinition, setProfileDefinition
init
public RestAuthenticator()
public RestAuthenticator(String url)
protected void internalInit()
InitializableObject
internalInit
in class InitializableObject
public void validate(UsernamePasswordCredentials credentials, WebContext context)
Authenticator
CredentialsException
in case of failure.validate
in interface Authenticator<UsernamePasswordCredentials>
credentials
- the given credentialscontext
- the web contextprotected void buildProfile(UsernamePasswordCredentials credentials, String body)
protected String callRestApi(String username, String password)
username
- the usernamepassword
- the passwordpublic String getUrl()
public void setUrl(String url)
public com.fasterxml.jackson.databind.ObjectMapper getMapper()
public void setMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Copyright © 2019. All rights reserved.