public class GoogleLoginServlet extends LoginServlet
GET googleLogin/popup - This endpoint is reached from the client-side popup when the user clicks login. - This servlet sends back a redirect to Google's login and authorization page. GET googleLogin/token - The callback URL from Google after the user has accepted or declined authorization. - If the user has declined, Google returns an error parameter in the callback URL. 1. In this case, we return some javascript code that closes the popup. - If the user has accepted, Google returns a one-time auth code parameter in the callback URL. 1. In this case, we make a POST back to Google with the auth code, and injected app information. 2. Google will then return a JSON with an encrypted ID Token in exchange for the one time auth code. 3. We unencrypt and verify this token using a Google's Java API to make sure the token is authentic. 4. Once authenticated, we take the user ID from the token and generate a security token with it. 5. Lastly, we return the security token client-side via some javascript, where it is also stored locally.
clientId, clientSecret, codec, CONTAINER, contextRoot, fetcher, redirectUriHTML_CONTENT_TYPE, JSON_CONTENT_TYPE| Constructor and Description |
|---|
GoogleLoginServlet() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp) |
void |
injectDependencies(String clientId,
String clientSecret,
String redirectUri,
org.apache.shindig.common.servlet.Authority authority) |
closePopup, injectDependencies, returnSecurityTokengetPaths, getRequestBody, parseResponseToJson, parseResponseToString, splitQuerycheckInitialized, initdoDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service@Inject public void injectDependencies(String clientId, String clientSecret, String redirectUri, org.apache.shindig.common.servlet.Authority authority)
protected void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
throws javax.servlet.ServletException,
IOException
doGet in class javax.servlet.http.HttpServletjavax.servlet.ServletExceptionIOExceptionCopyright © 2013 OpenSocial Foundation. All Rights Reserved.