public interface SqrlPersistence
SqrlJpaPersistenceProvider| Modifier and Type | Method and Description |
|---|---|
void |
cleanUpExpiredEntries()
Delete any expired objects in the persistence store
|
void |
closeCommit()
Commit all updates since this persistence object was created
|
void |
closeRollback()
Ignore all updates since this persistence object was created
|
void |
createAndEnableSqrlIdentity(String sqrlIdk,
Map<String,String> identityDataTable)
Create a new
SqrlIdentity and enable SQRL authentication |
SqrlCorrelator |
createCorrelator(String correlatorString,
Date expiryTime)
Create a new correlator instance in the persistence
|
void |
deleteSqrlCorrelator(SqrlCorrelator sqrlCorrelator) |
void |
deleteSqrlIdentity(String sqrlIdk)
Invoked when the user chooses to remove SQRL authentication for this site
|
boolean |
doesSqrlIdentityExistByIdk(String sqrlIdk)
Check persistence to see if a user exists with the given sqrlIdk
|
SqrlCorrelator |
fetchSqrlCorrelator(String correlator)
Fetch the correlator object for the given string value
|
SqrlCorrelator |
fetchSqrlCorrelatorRequired(String correlator)
Fetch the correlator object for the given string value, or throw an exception if it does not exist
|
Map<String,SqrlCorrelator> |
fetchSqrlCorrelatorsDetached(Set<String> correlatorStringSet) |
Map<String,SqrlAuthenticationStatus> |
fetchSqrlCorrelatorStatusUpdates(Map<String,SqrlAuthenticationStatus> correlatorToCurrentStatusTable)
Checks for correlators who's status has changed or is
SqrlAuthenticationStatus.AUTH_COMPLETE. |
Boolean |
fetchSqrlFlagForIdentity(String sqrlIdk,
SqrlFlag flagToFetch)
Invoked to determine if SQRL auth is enabled for a user
|
SqrlIdentity |
fetchSqrlIdentityByUserXref(String appUserXref)
Fetch the sqrl identity for the the given app user cross reference id
|
String |
fetchSqrlIdentityDataItem(String sqrlIdk,
String toFetch)
Request to the data store to retrieve user specific SQRL data that was previously stored via
#userAuthenticatedViaSqrl(String, String, Map) |
String |
fetchTransientAuthData(String correlator,
String transientNameServerParrot)
Fetch a short lived name/value for a given correlator and name
|
boolean |
hasTokenBeenUsed(String nutTokenString)
Check persistence to see if this token has already been used
|
boolean |
isClosed() |
void |
markTokenAsUsed(String nutTokenString,
Date expiryTime)
Mark the given token as used in persistence.
|
void |
setSqrlFlagForIdentity(String sqrlIdk,
SqrlFlag flagToSet,
boolean valueToSet)
Invoked when the user chooses to temporarily disable SQRL authentication for this site
|
void |
storeSqrlDataForSqrlIdentity(String sqrlIdk,
Map<String,String> dataToStore)
Indicates that we have received user specific data from the SQRL client that needs to be stored for the user;
NOTE this is often the first call made for a new SQRL identity, so if the identity does not currently
exist, it must be created
|
void |
updateIdkForSqrlIdentity(String previousSqrlIdk,
String newSqrlIdk)
The user has updated their SQRL ID but this application is still using the old one.
|
void |
updateNativeUserXref(long sqrlIdentityId,
String nativeUserXref)
Called to assign a native user cross reference to the given SQRL identity object so when SQRL authentication
takes place, the application knows which user has authenticated
|
void |
userAuthenticatedViaSqrl(String sqrlIdk,
String correlator)
Indicates that a user was authenticated successfully via SQRL.
|
void createAndEnableSqrlIdentity(String sqrlIdk, Map<String,String> identityDataTable)
SqrlIdentity and enable SQRL authenticationsqrlIdk - the idk of the SQRL identityidentityDataTable - auth data for this SQRL identityboolean doesSqrlIdentityExistByIdk(String sqrlIdk)
sqrlIdk - the SQRL ID to check forSqrlIdentity fetchSqrlIdentityByUserXref(String appUserXref)
appUserXref - the app user cross reference value to search byvoid updateIdkForSqrlIdentity(String previousSqrlIdk, String newSqrlIdk)
previousSqrlIdk - the old SQRL ID, which is present in persistencenewSqrlIdk - the new SQRL ID, which should replace previousSqrlIdk in persistencevoid deleteSqrlIdentity(String sqrlIdk)
sqrlIdk - the SQRL ID which represents the user.SqrlPersistenceException - if there was an error accessing the persistence storevoid updateNativeUserXref(long sqrlIdentityId,
String nativeUserXref)
sqrlIdentityId - the SQRL identity to updatenativeUserXref - the applications native user id for this uservoid userAuthenticatedViaSqrl(String sqrlIdk, String correlator)
sqrlIdk - the SQRL ID which the user authenticated with.correlator - The correlator ID that was generated when the login page was presented and embedded in the sqrl urldataToStore - SQRL related data that must be persisted for this user and be retreivable via
fetchSqrlIdentityDataItem(String, String)Boolean fetchSqrlFlagForIdentity(String sqrlIdk, SqrlFlag flagToFetch)
sqrlIdk - the SQRL ID which represents the user.SqrlEaabledState#NOT_EXIST if there is noneSqrlPersistenceException - if there was an error accessing the persistence storevoid setSqrlFlagForIdentity(String sqrlIdk, SqrlFlag flagToSet, boolean valueToSet)
sqrlIdk - the SQRL ID which represents the user.state - the auth state to set for this SQRL userSqrlPersistenceException - if there was an error accessing the persistence storevoid storeSqrlDataForSqrlIdentity(String sqrlIdk, Map<String,String> dataToStore)
sqrlIdk - the SQRL ID which the user authenticated with.dataToStore - SQRL related data that must be persisted for this user and be retreivable via
fetchSqrlIdentityDataItem(String, String)String fetchSqrlIdentityDataItem(String sqrlIdk, String toFetch)
#userAuthenticatedViaSqrl(String, String, Map)
sqrlIdk - the SQRL ID which the user authenticated with.toFetch - The name of the SQRL data to be fetched. Was the key in the Map whenboolean hasTokenBeenUsed(String nutTokenString)
nutTokenString - the SqrlNutToken token in sqbase64 format as received from the client the token sent by the
SQRL client in the requestvoid markTokenAsUsed(String nutTokenString, Date expiryTime)
#hasTokenBeenUsed(SqrlNutToken) must return true for this token until expiryTime. Once the expiryTime has
been reached, persistence cleanup can occur and this token can be deleted from persistencenutTokenString - the SqrlNutToken token in sqbase64 format as received from the clientexpiryTime - the time at which this token can safely be deleted from persistence since it will fail timestamp
validationString fetchTransientAuthData(String correlator, String transientNameServerParrot)
correlator - correlator to which this data belongsname - the name of the item to be fetchedSqrlCorrelator createCorrelator(String correlatorString, Date expiryTime)
correlatorString - the correlator value stringexpiryTime - the time at which this correlator expiresSqrlCorrelator fetchSqrlCorrelatorRequired(String correlator)
correlator - the string value to search forSqrlCorrelator fetchSqrlCorrelator(String correlator)
correlator - the string value to search forvoid closeCommit()
void closeRollback()
boolean isClosed()
void cleanUpExpiredEntries()
Map<String,SqrlCorrelator> fetchSqrlCorrelatorsDetached(Set<String> correlatorStringSet)
Map<String,SqrlAuthenticationStatus> fetchSqrlCorrelatorStatusUpdates(Map<String,SqrlAuthenticationStatus> correlatorToCurrentStatusTable)
SqrlAuthenticationStatus.AUTH_COMPLETE. Complete
state is always returned in case the client didn't get the update the first time it was sentcorrelatorToCurrentStatusTable - table of string correlators and their current state as sent by the browservoid deleteSqrlCorrelator(SqrlCorrelator sqrlCorrelator)
Copyright © 2016. All rights reserved.