public class MobileIDAuthenticator
extends java.lang.Object
Use startLogin(java.lang.String, java.lang.String) to initiate the login session and display challenge to the user,
then waitForLogin(MobileIDSession) to wait for the authentication to complete.
Various setters can be used to configure the behaviour.
| Constructor and Description |
|---|
MobileIDAuthenticator() |
MobileIDAuthenticator(java.lang.String digidocServiceURL) |
MobileIDAuthenticator(java.lang.String digidocServiceURL,
java.lang.String serviceName) |
MobileIDAuthenticator(java.net.URL digidocServiceURL) |
MobileIDAuthenticator(java.net.URL digidocServiceURL,
java.lang.String serviceName) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
generateSPChallenge() |
boolean |
isLoginComplete(MobileIDSession session)
Checks whether login is already complete.
|
MobileIDAuthenticator |
setDigidocServiceURL(java.lang.String digidocServiceURL) |
MobileIDAuthenticator |
setDigidocServiceURL(java.net.URL digidocServiceURL) |
void |
setLanguage(java.lang.String language) |
void |
setLoginMessage(java.lang.String loginMessage) |
void |
setPollIntervalMs(int pollIntervalMs) |
void |
setRetryCount(int retryCount) |
void |
setServiceName(java.lang.String serviceName) |
MobileIDSession |
startLogin(java.lang.String phone)
Initiates the login session.
|
MobileIDSession |
startLogin(java.lang.String personalCode,
java.lang.String countryCode)
Initiates the login session.
|
protected MobileIDSession |
startLogin(java.lang.String personalCode,
java.lang.String countryCode,
java.lang.String phone) |
MobileIDSession |
waitForLogin(MobileIDSession session)
Waits until user confirms their identity using the mobile device.
|
public MobileIDAuthenticator()
public MobileIDAuthenticator(java.lang.String digidocServiceURL)
public MobileIDAuthenticator(java.lang.String digidocServiceURL,
java.lang.String serviceName)
public MobileIDAuthenticator(java.net.URL digidocServiceURL)
public MobileIDAuthenticator(java.net.URL digidocServiceURL,
java.lang.String serviceName)
public final MobileIDAuthenticator setDigidocServiceURL(java.lang.String digidocServiceURL)
public final MobileIDAuthenticator setDigidocServiceURL(java.net.URL digidocServiceURL)
public void setLanguage(java.lang.String language)
public void setServiceName(java.lang.String serviceName)
public void setLoginMessage(java.lang.String loginMessage)
public void setRetryCount(int retryCount)
public void setPollIntervalMs(int pollIntervalMs)
public MobileIDSession startLogin(java.lang.String personalCode, java.lang.String countryCode)
personalCode - user's personal codecountryCode - two letter country code, eg EEAuthenticationException - is authentication unsuccessfulpublic MobileIDSession startLogin(java.lang.String phone)
phone - phone number with country code (eg "+37255667788" or "37255667788").AuthenticationException - is authentication unsuccessfulprotected MobileIDSession startLogin(java.lang.String personalCode, java.lang.String countryCode, java.lang.String phone)
protected java.lang.String generateSPChallenge()
public MobileIDSession waitForLogin(MobileIDSession session)
This is a blocking version of isLoginComplete(MobileIDSession)
session - previously returned by startLogin(java.lang.String, java.lang.String)AuthenticationException - is authentication unsuccessfulpublic boolean isLoginComplete(MobileIDSession session)
This is a non-blocking version of waitForLogin(MobileIDSession)
session - previously returned by startLogin(java.lang.String, java.lang.String)