Skip to content

Commit

Permalink
Consolidate AppId for web-based and app-based U2F requests. (google#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoliu1988 authored and leshi committed Apr 18, 2017
1 parent 100bc55 commit ebad530
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp)
boolean allowReregistration = Boolean.valueOf(req.getParameter("reregistration"));
RegistrationRequest registrationRequest;
U2fSignRequest signRequest;
String appId = (req.isSecure() ? "https://" : "http://") + req.getHeader("Host");
String appId =
(req.isSecure() ? "https://" : "http://") + req.getHeader("Host") + "/origins.json";

try {
registrationRequest = u2fServer.getRegistrationRequest(user.getEmail(), appId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOEx
User user = userService.getCurrentUser();

U2fSignRequest signRequest;
String appId = (req.isSecure() ? "https://" : "http://") + req.getHeader("Host");
String appId =
(req.isSecure() ? "https://" : "http://") + req.getHeader("Host") + "/origins.json";
try {
signRequest = u2fServer.getSignRequest(user.getEmail(), appId);
} catch (U2FException e) {
Expand Down
4 changes: 4 additions & 0 deletions u2f-gae-demo/war/origins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"trustedFacets" : [{
"version": { "major": 1, "minor" : 0 },
"ids": [
"http://localhost:8888",
"https://u2fdemo.appspot.com",
"https://crxjs-dot-u2fdemo.appspot.com",
"https://noext-dot-u2fdemo.appspot.com",
"android:apk-key-hash:bkHnlWEV_jRCPdYGJfwOl7Sn_CLC_2TE3h4TO1_n34I"
]
}]
Expand Down

0 comments on commit ebad530

Please sign in to comment.