|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.lyo.server.oauth.webapp.services.OAuthService
public class OAuthService
Issues OAuth request tokens, handles authentication, and then exchanges
request tokens for access tokens based on the OAuth configuration set in the
OAuthConfiguration
singleton.
Field Summary | |
---|---|
protected javax.servlet.http.HttpServletRequest |
httpRequest
|
protected javax.servlet.http.HttpServletResponse |
httpResponse
|
Constructor Summary | |
---|---|
OAuthService()
|
Method Summary | |
---|---|
javax.ws.rs.core.Response |
authorize()
Responds with a web page to log in. |
javax.ws.rs.core.Response |
authorize(String requestToken)
|
protected boolean |
confirmCallback(OAuthRequest oAuthRequest)
|
javax.ws.rs.core.Response |
doGetAccessToken()
|
javax.ws.rs.core.Response |
doGetRequestToken()
|
javax.ws.rs.core.Response |
doPostAccessToken()
Responds with an access token and token secret for valid OAuth requests. |
javax.ws.rs.core.Response |
doPostRequestToken()
Responds with a request token and token secret. |
javax.ws.rs.core.Response |
login(String id,
String password)
Validates that the ID and password are for an administrator. |
javax.ws.rs.core.Response |
login(String id,
String password,
String requestToken)
Validates the ID and password on the authorization form. |
javax.ws.rs.core.Response |
provisionalKey()
Generates a provisional consumer key. |
protected javax.ws.rs.core.Response |
respondWithOAuthProblem(net.oauth.OAuthException e)
|
protected javax.ws.rs.core.Response |
respondWithToken(String token,
String tokenSecret)
|
protected javax.ws.rs.core.Response |
respondWithToken(String token,
String tokenSecret,
boolean callbackConfirmed)
|
javax.ws.rs.core.Response |
showApproveKeyPage(String key)
Shows the approval page for a single provisional consumer. |
javax.ws.rs.core.Response |
showConsumerKeyManagementPage()
Shows the consumer management page, which allows administrator to approve or remove OAuth consumers. |
protected OAuthRequest |
validateRequest()
Validates this is a known consumer and the request is valid using OAuthValidator.validateMessage(net.oauth.OAuthMessage, OAuthAccessor) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Context protected javax.servlet.http.HttpServletRequest httpRequest
@Context protected javax.servlet.http.HttpServletResponse httpResponse
Constructor Detail |
---|
public OAuthService()
Method Detail |
---|
public javax.ws.rs.core.Response doGetRequestToken() throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public javax.ws.rs.core.Response doPostRequestToken() throws IOException, javax.servlet.ServletException
IOException
- on I/O errors
javax.servlet.ServletException
- on servlet errorsprotected boolean confirmCallback(OAuthRequest oAuthRequest) throws net.oauth.OAuthException
net.oauth.OAuthException
public javax.ws.rs.core.Response authorize() throws javax.servlet.ServletException, IOException
IOException
- on I/O errors
javax.servlet.ServletException
- on internal errors validating the requestpublic javax.ws.rs.core.Response login(String id, String password, String requestToken)
public javax.ws.rs.core.Response authorize(String requestToken)
public javax.ws.rs.core.Response doGetAccessToken() throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public javax.ws.rs.core.Response doPostAccessToken() throws IOException, javax.servlet.ServletException
IOException
- on I/O errors
javax.servlet.ServletException
- on servlet errorspublic javax.ws.rs.core.Response provisionalKey() throws NullPointerException, IOException
IOException
NullPointerException
public javax.ws.rs.core.Response showApproveKeyPage(String key) throws javax.servlet.ServletException, IOException
key
- the consumer
javax.servlet.ServletException
- on errors showing the JSP
IOException
- on errors showing the JSPshowConsumerKeyManagementPage()
public javax.ws.rs.core.Response showConsumerKeyManagementPage() throws javax.servlet.ServletException, IOException
javax.servlet.ServletException
- on JSP errors
IOException
- on JSP errorspublic javax.ws.rs.core.Response login(String id, String password)
protected OAuthRequest validateRequest() throws net.oauth.OAuthException, IOException
OAuthValidator.validateMessage(net.oauth.OAuthMessage, OAuthAccessor)
.
Does not check for any tokens.
net.oauth.OAuthException
- if the request fails validation
IOException
- on I/O errorsprotected javax.ws.rs.core.Response respondWithToken(String token, String tokenSecret) throws IOException
IOException
protected javax.ws.rs.core.Response respondWithToken(String token, String tokenSecret, boolean callbackConfirmed) throws IOException
IOException
protected javax.ws.rs.core.Response respondWithOAuthProblem(net.oauth.OAuthException e) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |