public class StormpathAuthenticator extends ProfileDefinitionAware<StormpathProfile> implements Authenticator<UsernamePasswordCredentials>
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
logger |
Constructor and Description |
---|
StormpathAuthenticator() |
StormpathAuthenticator(String accessId,
String secretKey,
String applicationId) |
Modifier and Type | Method and Description |
---|---|
protected com.stormpath.sdk.account.Account |
authenticateAccount(UsernamePasswordCredentials credentials) |
protected StormpathProfile |
createProfile(com.stormpath.sdk.account.Account account) |
String |
getAccessId() |
String |
getApplicationId() |
String |
getSecretKey() |
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
void |
setAccessId(String accessId) |
void |
setApplicationId(String applicationId) |
void |
setSecretKey(String secretKey) |
void |
validate(UsernamePasswordCredentials credentials,
WebContext context)
Validate the credentials.
|
defaultProfileDefinition, getProfileDefinition, setProfileDefinition
init, reinit
public StormpathAuthenticator()
public StormpathAuthenticator(String accessId, String secretKey, String applicationId)
accessId
- accessId provided by Stormpath, for the admin user with the created API key.secretKey
- secret key provided by Stormpath, for the admin user with the created API key.applicationId
- This is application id configured on Stormpath whose login source will be used to authenticate users.protected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class InitializableWebObject
context
- the web contextpublic void validate(UsernamePasswordCredentials credentials, WebContext context) throws HttpAction, CredentialsException
Authenticator
CredentialsException
in case of failure.validate
in interface Authenticator<UsernamePasswordCredentials>
credentials
- the given credentialscontext
- the web contextHttpAction
- requires a specific HTTP action if necessaryCredentialsException
- the credentials are invalidprotected com.stormpath.sdk.account.Account authenticateAccount(UsernamePasswordCredentials credentials) throws com.stormpath.sdk.resource.ResourceException
com.stormpath.sdk.resource.ResourceException
protected StormpathProfile createProfile(com.stormpath.sdk.account.Account account)
public String getAccessId()
public void setAccessId(String accessId)
public String getSecretKey()
public void setSecretKey(String secretKey)
public String getApplicationId()
public void setApplicationId(String applicationId)
Copyright © 2017. All rights reserved.