public class VerificationServlet
extends javax.servlet.http.HttpServlet
| Constructor and Description |
|---|
VerificationServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
A GET request was received for this servlet.
|
protected void |
doVerificationRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Create a verification request and show a page with the verification link.
|
protected void |
doVerificationResponse(String state,
String token,
String verifier,
javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Creates access credentials after the verification was passed.
|
protected String |
fetchVerificationSecret(String token)
Returns the secret for a previously created verification token.
|
protected AbstractClient |
getClient()
Create a client for communication with the IS24-Webservice.
|
protected Authorization |
getWebserviceAuthorization(String token,
String secret,
String verifier,
javax.servlet.http.HttpServletRequest req)
Generates credentials for permanent authoriation at the IS24-Webservice.
|
protected Verification |
getWebserviceVerification(javax.servlet.http.HttpServletRequest req)
Generates credentials for a verification process at the IS24-Webservice.
|
void |
init()
Servlet is initialized by the servlet engine.
|
protected void |
removeVerificationSecret(String token)
Remove a previously created verification token from the local store.
|
protected void |
storeVerification(Verification verification)
Store newly created verification credentials to the local store.
|
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceprotected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws IOException,
javax.servlet.ServletException
The functions decides according to the request parameters, if a verification is requested or if the response of a verification is processed.
doGet in class javax.servlet.http.HttpServletreq - incoming GET requestresp - outgoing responseIOExceptionjavax.servlet.ServletExceptionprotected void doVerificationRequest(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws IOException,
javax.servlet.ServletException
req - incoming GET requestresp - outgoing responseIOExceptionjavax.servlet.ServletExceptionprotected void doVerificationResponse(String state, String token, String verifier, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp) throws IOException, javax.servlet.ServletException
The generated access token and secret is shown to the user by default.
state - the state of verification, that was received as request
parameter by the webservicetoken - the verification token, that was received as request parameter
by the webserviceverifier - the verification code, that was received as request
parameter by the webservicereq - incoming GET requestresp - outgoing responseIOExceptionjavax.servlet.ServletExceptionprotected String fetchVerificationSecret(String token)
By default the created verification credentials are stored in memory. You should replace this method in productive systems - e.g. with a database backend.
token - verification tokenprotected AbstractClient getClient()
protected Authorization getWebserviceAuthorization(String token, String secret, String verifier, javax.servlet.http.HttpServletRequest req) throws oauth.signpost.exception.OAuthException
token - verification tokensecret - verification secretverifier - verification codereq - incoming GET requestoauth.signpost.exception.OAuthExceptionprotected Verification getWebserviceVerification(javax.servlet.http.HttpServletRequest req) throws oauth.signpost.exception.OAuthException
req - incoming GET requestoauth.signpost.exception.OAuthExceptionpublic void init()
throws javax.servlet.ServletException
init in class javax.servlet.GenericServletjavax.servlet.ServletExceptionprotected void removeVerificationSecret(String token)
By default the created verification credentials are stored in memory. You should replace this method in productive systems - e.g. with a database backend.
token - verification tokenprotected void storeVerification(Verification verification)
By default the created verification credentials are stored in memory. You should replace this method in productive systems - e.g. with a database backend.
verification - verification credentialsCopyright © 2014 OpenEstate. All rights reserved.