Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
step one of AccountChooser integration: adding storeAccount api call and
a page to invoke the js.
- Loading branch information
primmer
committed
Sep 17, 2012
1 parent
0b8b153
commit be1609a
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/appengine-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
This comment has been minimized.
Sorry, something went wrong. |
||
<%@ page import="guestbook.UserServlet" %> | ||
<%@ page import="java.util.List" %> | ||
<%@ page import="javax.servlet.http.HttpSession" %> | ||
|
||
<% | ||
// The page is loaded at the end of a sign-in or account creation. | ||
// It loads the "save" feature of Account Chooser. The browser is | ||
// redirected to accountchooser.com and has the option to store the | ||
// currently signed in account. If the account is currently stored, | ||
// the ac.js redirects to the homeurl location. | ||
String user_id = (String) session.getAttribute("user_id"); | ||
String name = (String) session.getAttribute("name"); | ||
String photo = (String) session.getAttribute("photo"); | ||
// Don't bother trying to store the account if there's no user_id. | ||
if (user_id == null || user_id.isEmpty()) { | ||
response.sendRedirect("/guestbook.jsp"); | ||
} | ||
%> | ||
|
||
<html> | ||
<head> | ||
|
||
<!-- Begin AC integration --> | ||
<script type="text/javascript" src="https://www.accountchooser.com/ac.js"> | ||
storeAccount: { | ||
// After the storeAccount method, redirect to homeUrl" | ||
homeUrl: '/guestbook.jsp', | ||
email: '<%= user_id %>', | ||
displayName: '<%= name %>', | ||
photoUrl: '<%= photo %>' | ||
} | ||
</script> | ||
<!-- End AC integration --> | ||
|
||
</head> | ||
<body> | ||
</body> | ||
</html> |
1 comment
on commit be1609a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requesting for pull request
Mike