public class SqrlServerOperations extends Object
| Constructor and Description |
|---|
SqrlServerOperations(SqrlConfig config)
Initializes the operations class with the given config, defaulting to the built in JPA persisentce provider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanSqrlAuthData(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Clears SQRL auth one time use data from the browser and database
|
void |
deleteSqrlAuthCookies(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Called by the web app once authentication is complete to cleanup any cookies set by the SQRL library
|
void |
deleteSqrlCorrelator(SqrlCorrelator sqrlCorrelator) |
long |
determineNutExpiry(javax.servlet.http.HttpServletRequest request)
Looks for the SQRL first nut cookie and extracts the time at which it expires
|
String |
extractSqrlCorrelatorStringFromRequestCookie(javax.servlet.http.HttpServletRequest request)
Checks the request and trys to extract the correlator string from the cookie.
|
SqrlCorrelator |
fetchSqrlCorrelator(javax.servlet.http.HttpServletRequest request) |
SqrlCorrelator |
fetchSqrlCorrelator(String correlatorString) |
Map<String,SqrlCorrelator> |
fetchSqrlCorrelatorsDetached(Set<String> correlatorStringSet) |
Map<String,SqrlAuthenticationStatus> |
fetchSqrlCorrelatorStatusUpdates(Map<String,SqrlAuthenticationStatus> correlatorToCurrentStatusTable) |
SqrlIdentity |
fetchSqrlIdentityByUserXref(String webAppUserCrossReference)
Invoked to see if a web app user has a corresponding SQRL identity registered
|
void |
handleSqrlClientRequest(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
The backchannel servlet which is accepting requests from SQRL clients should call this method to process the
request
|
SqrlAuthPageData |
prepareSqrlAuthPageData(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
InetAddress userInetAddress,
int qrCodeSizeInPixels)
Called to generate the data the server needs to display to allow a user to authenticate via SQRL
|
protected boolean |
processClientCommand(SqrlClientRequest request,
SqrlNutToken nutToken,
SqrlTif.TifBuilder tifBuilder,
String correlator) |
static void |
setExecutor(SqrlServiceExecutor sqrlServiceExecutor)
Poor mans dependency injection.
|
void |
updateNativeUserXref(SqrlIdentity sqrlIdentity,
String nativeUserCrossReference) |
public SqrlServerOperations(SqrlConfig config)
sqrlPersistence - the persistence to be used for storing and retreiving SQRL dataconfig - the SQRL settings to be usedSqrlExceptionpublic static void setExecutor(SqrlServiceExecutor sqrlServiceExecutor)
sqrlServiceExecutor - public SqrlAuthPageData prepareSqrlAuthPageData(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, InetAddress userInetAddress, int qrCodeSizeInPixels) throws SqrlException
request - the servlet requestresponse - userInetAddress - the IP address of the users browserqrCodeSizeInPixels - the size (in pixels) that the generated QR code will beSqrlException - if an error occurspublic void handleSqrlClientRequest(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
throws IOException
servletRequest - the servlet requestservletResponse - the servlet response which will be populated accordinglyIOException - if an IO error occursprotected boolean processClientCommand(SqrlClientRequest request, SqrlNutToken nutToken, SqrlTif.TifBuilder tifBuilder, String correlator) throws SqrlException
SqrlExceptionpublic void deleteSqrlAuthCookies(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
request - the HTTP requestresponse - the HTTP responsepublic long determineNutExpiry(javax.servlet.http.HttpServletRequest request)
throws SqrlException
request - the HTTP requestSqrlException - if an error occurspublic void updateNativeUserXref(SqrlIdentity sqrlIdentity, String nativeUserCrossReference)
public String extractSqrlCorrelatorStringFromRequestCookie(javax.servlet.http.HttpServletRequest request)
public SqrlCorrelator fetchSqrlCorrelator(javax.servlet.http.HttpServletRequest request)
public SqrlCorrelator fetchSqrlCorrelator(String correlatorString)
public SqrlIdentity fetchSqrlIdentityByUserXref(String webAppUserCrossReference)
webAppUserCrossReference - the username, customer id, or whatever mechanism is used to uniquely identify users in the web apppublic Map<String,SqrlCorrelator> fetchSqrlCorrelatorsDetached(Set<String> correlatorStringSet)
public Map<String,SqrlAuthenticationStatus> fetchSqrlCorrelatorStatusUpdates(Map<String,SqrlAuthenticationStatus> correlatorToCurrentStatusTable)
public void deleteSqrlCorrelator(SqrlCorrelator sqrlCorrelator)
public void cleanSqrlAuthData(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Copyright © 2016. All rights reserved.