3 Star 0 Fork 0

Gitee 极速下载 / u2f-ref-code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/google/u2f-ref-code
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
BSD-3-Clause

Reference code for U2F specifications

This code implements the FIDO U2F specifications being developed at http://fidoalliance.org/. This code is intended as a reference and resource for developers who are interested in exploring U2F. The code consists of the following components:

Java U2F implementation

This code can verify U2F registrations and signatures. A web application built to accept U2F 2nd factor is built on top of a code base such as this. The code base includes a trivial web application so the user can experiment with registration and signatures (also see the sample web app below).

A virtual (software) U2F device

This is a Java implementation of a U2F device. It generates registration and signature statements and is meant for testing against your server implementation. A physical U2F device will generate similar statements.

A sample web app that uses U2F

This is a sample application built on the Google App Engine web platform which demonstrates a possible UX for user interaction with U2F in a web page. The sample application is deployed and available live at https://u2fdemo.appspot.com/. The underlying U2F capability is provided by the Java U2F implementation. A developer can take the core ideas from here and integrate U2F into a web application on their own favorite web app platform.

Getting started

u2f-ref-code is a self contained java project that includes a basic web server and includes packages for all crypto, utilities, etc. It does not need to run in a container or application server like Tomcat. To run the demo server, run the main class in com.google.u2f.tools.httpserver.U2fHttpServer

To compile and run the server in Eclipse, import the Maven project into your workspace. You may need to fix the classpath if your version of JDK is different (this has been tested with Java 1.7). The simple demo web server is in com.google.u2f.tools.httpserver.U2fHttpServer.java and runs on port 8080. Run this class as a regular Java application (right click, select Run As and Java Application). Note that you need to have the U2F extension installed in Chrome in order for the demo app to talk to your U2F token.

To run directly with Maven, run mvn compile exec:java from the u2f-ref-code directory.

U2F-GAE-Demo

The u2f-gae-demo project is a sample application built on the Google App Engine web platform which demonstrates a possible UX for user interaction with U2F in a web page.

To start the development server with Maven, run mvn appengine:devserver. This will run the server locally at http://localhost:8888/.

As above, if importing the Maven project into Eclipse you might have to adjust JDK versions, App Engine SDK version, etc. Once everything compiles, you can run the App Engine server locally and point Google Chrome at http://localhost:8888/.

The built-in support for U2F in Google Chrome only works on HTTPS sites. To test the app on http://localhost:8888, which uses HTTP, you need to do the following:

Use the built-in chrome support

  • Quit all instances of Google Chrome.

  • Restart Google Chrome with the --show-component-extension-options command-line flag.

  • Navigate to chrome://extensions and enable Developer Mode by clicking a checkbox in the top right corner.

  • Find the CryptoTokenExtension extension.

  • Click on "background page". This will open a Developer Tools window, including a Console.

  • In the console, type:

      HTTP_ORIGINS_ALLOWED = true;
  • Then, point your browser at http://localhost:8888/

You can deploy this App Engine app to your own domain by changing the application name in u2f-gae-demo/war/WEB-INF/appengine-web.xml.

Copyright 2014, Google Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Google Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

简介

暂无描述 展开 收起
JavaScript 等 6 种语言
BSD-3-Clause
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/mirrors/u2f-ref-code.git
git@gitee.com:mirrors/u2f-ref-code.git
mirrors
u2f-ref-code
u2f-ref-code
master

搜索帮助