public class CodeAuthentication extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
CodeAuthentication.Identity
The Class Identity.
|
| Modifier and Type | Field and Description |
|---|---|
static long |
IDENTITY_LIFETIME
Lifetime of an identity in milliseconds.
|
protected static org.exoplatform.services.log.Log |
LOG
The Constant LOG.
|
| Constructor and Description |
|---|
CodeAuthentication(org.exoplatform.services.idgenerator.IDGeneratorService idGenerator,
org.exoplatform.services.jcr.RepositoryService jcrService)
Instantiates a new code authentication.
|
| Modifier and Type | Method and Description |
|---|---|
String |
authenticate(String serviceURL,
String user,
String password)
Create user identity for given user name, password and a service URL.
|
CodeAuthentication.Identity |
exchangeCode(String code)
Exchange given code on user identity associated with this code in
authenticate(String, String, String). |
boolean |
hasCode(String code)
Deprecated.
|
boolean |
hasCodeContext(String code)
Deprecated.
|
void |
setCodeContext(String code,
String context)
Set identity context for a code.
|
public static final long IDENTITY_LIFETIME
protected static final org.exoplatform.services.log.Log LOG
public CodeAuthentication(org.exoplatform.services.idgenerator.IDGeneratorService idGenerator,
org.exoplatform.services.jcr.RepositoryService jcrService)
idGenerator - the id generatorjcrService - the jcr servicepublic String authenticate(String serviceURL, String user, String password)
exchangeCode(String).serviceURL - Stringuser - Stringpassword - StringStringexchangeCode(String)@Deprecated public boolean hasCode(String code)
code - the codepublic CodeAuthentication.Identity exchangeCode(String code) throws AuthenticationException
authenticate(String, String, String). User identity after this
method may be not fully initialized as for its context. Identity context is
optional and can be initialized by setCodeContext(String, String)
method once, after that call identity will be fully removed from the
authenticator.AuthenticationException will be thrown.code - StringCodeAuthentication.Identity of an userAuthenticationException - if code doesn't match any usersetCodeContext(String, String)public void setCodeContext(String code, String context) throws AuthenticationException
exchangeCode(String), after this it will be fully removed from the
authenticator.AuthenticationException will be thrown.code - Stringcontext - StringAuthenticationException - the authentication exceptionexchangeCode(String)@Deprecated public boolean hasCodeContext(String code)
code - the codeCopyright © 2003–2020 eXo Platform SAS. All rights reserved.