Skip to content

Commit 2b5fa02

Browse files
committed
Merge the no-extension branch into the master branch.
Also adds a readme file to explain how to deploy a server that talks to the U2F extension or to the built-in Chrome packaged app.
1 parent e7e4ea3 commit 2b5fa02

9 files changed

Lines changed: 791 additions & 172 deletions

File tree

u2f-chrome-extension/README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ do not modify/remove the key in ``manifest.json``.
1616

1717
## Communicating with the extension
1818

19-
The simplest way for web pages to talk to the extension is to load the script
20-
``chrome-extension://pfboblefjcgdjicmnffhdgionmgcdmne/u2f-api.js``. This installs
21-
a namespace ``u2f`` as described in U2F JavaScript API draft sent to the mailing
22-
list. If you are willing to load this script in your pages, you can safely skip
23-
the remainder of this section.
24-
25-
The U2F JavaScript API draft also describes how websites can talk directly to
19+
The U2F JavaScript API draft describes how websites can talk directly to
2620
the extension via a [MessagePort][messageport], in cases where they do not
2721
whish to load a script from the extension. How a port to this extension is
2822
obtained depends on whether the source origin is whitelisted as *externally
@@ -71,8 +65,6 @@ function getIframePort(callback) {
7165
};
7266
```
7367

74-
For a full example refer to ``u2f-api.js``.
75-
7668
The drawback of this transport is that the websites [TLS channel id][channelid]
7769
will not be available to the extension, and thus not included in signed U2F
7870
assertions.
@@ -92,9 +84,7 @@ obtaining a message port to the extension is simpler:
9284
```
9385

9486
The returned port will be a Chrome runtime port object, which has slightly
95-
different syntax for how event handlers are added. Again, see ``u2f-api.js``
96-
for a full example and how to wrap this in a HTML5 MessagePort compatible
97-
interface.
87+
different syntax for how event handlers are added.
9888

9989
### Extending the extension with an external helper
10090

u2f-gae-demo/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# U2F Demo Deployment
2+
3+
To deploy https://noext-dot-u2fdemo.appspot.com and configure the appspot
4+
server to the extension that is built into Chrome, you have to:
5+
(1) Set the version value to 'noext' in appengine-web.xml
6+
<version>noext</version>
7+
(2) Set the extension id in u2f-api.js to 'pfboblefjcgdjicmnffhdgionmgcdmne'
8+
u2f.EXTENSION_ID = 'pfboblefjcgdjicmnffhdgionmgcdmne';
9+
10+
11+
To deploy https://crxjs-dot-u2fdemo.appspot.com and configure the appspot
12+
server to the U2F extension you have to:
13+
(1) Set the version value to 'crxjs' in appengine-web.xml
14+
<version>crxjs</version>
15+
(2) Set the extension id in u2f-api.js to 'kmendfapggjehodndflmmgagdbamhnfd'
16+
u2f.EXTENSION_ID = 'kmendfapggjehodndflmmgagdbamhnfd';
17+
18+

u2f-gae-demo/src/com/google/u2f/gaedemo/AppModule.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public U2FServer provideU2FServer(ChallengeGenerator challengeGenerator, Crypto
7373
// this implementation will only accept signatures from the following origins:
7474
"http://localhost:8888",
7575
"https://u2fdemo.appspot.com",
76-
"https://crxjs-dot-u2fdemo.appspot.com"));
76+
"https://crxjs-dot-u2fdemo.appspot.com",
77+
"https://noext-dot-u2fdemo.appspot.com"));
7778
}
7879
}

u2f-gae-demo/src/soy/main.soy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
<script src="/jquery/js/jquery-1.10.2.js"></script>
1818
<script src="/jquery/js/jquery-ui-1.10.4.custom.js"></script>
1919

20-
<script type="text/javascript" src="chrome-extension://pfboblefjcgdjicmnffhdgionmgcdmne/u2f-api.js"></script>
21-
20+
<script type="text/javascript" src="/js/u2f-api.js"></script>
2221
<script type="text/javascript" src="/js/u2fdemo.js"></script>
2322
<link rel="stylesheet" type="text/css" href="/css/u2fdemo.css">
2423

u2f-gae-demo/war/WEB-INF/appengine-web.xml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
33
<application>u2fdemo</application>
4-
<version>crxjs</version>
4+
5+
<!--
6+
Version of the no-extension deployment.
7+
Uncomment this if you want to deploy a server instance that uses the extension that is built into Chrome.
8+
-->
9+
<version>noext</version>
10+
11+
<!--
12+
Version of the extension deployment.
13+
Uncomment this if you want to deploy a server instance that uses the U2F Chrome extension.
14+
15+
<version>crxjs</version>
16+
-->
517

618
<!--
719
Allows App Engine to send multiple requests to one instance in parallel:

0 commit comments

Comments
 (0)