public abstract class Session extends Object
For each user going through the OpenID protocol, one instance is created.
| Modifier and Type | Field and Description |
|---|---|
OpenIDServer |
server |
| Constructor and Description |
|---|
Session(OpenIDServer server) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract org.kohsuke.stapler.HttpResponse |
authenticateUser(OpenIDIdentity id)
When the protocol gets to the point of needing to authenticate the user on the server side,
this method is called.
|
void |
doDynamic(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
"/~USERID" is mapped to OpenID.
|
org.kohsuke.stapler.HttpResponse |
doEntryPoint(org.kohsuke.stapler.StaplerRequest request)
Landing page for the OpenID protocol.
|
OpenIDIdentity |
getIdentity()
Returns the current user's identity.
|
String |
getRealm()
A string that represents the client who is requesting an authentication.
|
String |
getReturnTo()
URL to send the user back to, once the authentication is complete.
|
org.kohsuke.stapler.HttpResponse |
handleRequest() |
protected org.openid4java.message.ax.FetchResponse |
respondToAx(org.openid4java.message.ax.FetchRequest req) |
protected void |
respondToFetchRequest(org.openid4java.message.Message rsp)
Responds to the fetch request by adding them.
|
protected org.openid4java.message.sreg.SRegResponse |
respondToSReg(org.openid4java.message.sreg.SRegRequest req) |
public final OpenIDServer server
public Session(OpenIDServer server)
public String getRealm()
This value can be trusted, even though it came from the client.
public String getReturnTo()
public OpenIDIdentity getIdentity()
authenticateUser(OpenIDIdentity),
and is null until the authentication gets to that point.public org.kohsuke.stapler.HttpResponse doEntryPoint(org.kohsuke.stapler.StaplerRequest request)
throws IOException
IOExceptionprotected abstract org.kohsuke.stapler.HttpResponse authenticateUser(OpenIDIdentity id)
If the user needs to be redirected elsewhere for the server to authenticate (such as sending
him to the login page), this method can return a non-null object (for example see HttpResponses.redirectViaContextPath(String))
or throw an HttpResponse as an exception. The caller will use this
HttpResponse as a response to the client.
After such authentication, the handleRequest() must be called to pick up the OpenID
dance where we left off.
If the user is already authenticated on the server side, then the OpenIDIdentity object
should be populated with the information about the user, and this method shall return null.
In this case, the protocol will continue.
Another common practice is to verify with the user that he actually intended to login to the realm requesting authentication.
public org.kohsuke.stapler.HttpResponse handleRequest()
protected void respondToFetchRequest(org.openid4java.message.Message rsp)
throws org.openid4java.message.MessageException
org.openid4java.message.MessageExceptionprotected org.openid4java.message.sreg.SRegResponse respondToSReg(org.openid4java.message.sreg.SRegRequest req)
throws org.openid4java.message.MessageException
org.openid4java.message.MessageExceptionprotected org.openid4java.message.ax.FetchResponse respondToAx(org.openid4java.message.ax.FetchRequest req)
throws org.openid4java.message.MessageException
org.openid4java.message.MessageExceptionpublic void doDynamic(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionCopyright © 2012. All Rights Reserved.