Skip to content

Commit c7e27cb

Browse files
committed
add developers wiki for nrf52-u2f
1 parent 747fe58 commit c7e27cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+823
-0
lines changed

docs/CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Interested in contributing to this project? Want to report a bug? Before you do, please read the following guidelines.
2+
3+
## Got a question or found a bug?
4+
5+
If you got a question or found a bug in this project, you can help us by submitting an issue to the [issue tracker](https://github.com/makerdiary/nrf52-u2f/issues) in our GitHub repository. Even better, you can submit a Pull Request with a fix.
6+
7+
## Missing a feature?
8+
9+
You can request a new feature by submitting an issue to our GitHub Repository. Be sure that it is of use for everyone.
10+
11+
<a href="https://github.com/makerdiary/nrf52-u2f/issues/new"><button data-md-color-primary="marsala"><i class="fa fa-github"></i> Create an Issue</button></a>

docs/LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**MIT License**
2+
3+
Copyright (c) 2018 [makerdiary](https://makerdiary.com)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
429 KB
Loading

docs/building/index.md

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
# How to build the nRF52-U2F Firmware?
2+
3+
This section describes how to build a new nRF52-U2F firmware and bootloader for your security key.
4+
5+
## Install Dependencies
6+
7+
To build the nRF52-U2F, you need to install some additional dependencies.
8+
9+
On Windows, the easiest way to install dependencies is to use the [MSYS2](http://www.msys2.org/). You can do so by performing the following steps:
10+
11+
1. [Download](http://www.msys2.org/) and run the installer - "x86_64" for 64-bit, "i686" for 32-bit Windows.
12+
13+
2. Run MSYS2 from Start menu and install dependencies with:
14+
15+
``` sh
16+
# Update the package database and core system packages
17+
$ pacman -Syu
18+
19+
# Install dependencies
20+
$ pacman -S git make python2 openssl
21+
```
22+
23+
24+
Linux and macOS already have some necessary shell commands, run the following command to install the rest:
25+
26+
``` sh
27+
# On macOS
28+
$ brew install openssl
29+
30+
# On Ubuntu
31+
$ sudo apt-get install build-essential checkinstall openssl
32+
```
33+
34+
## Clone the nRF52-U2F Repository
35+
36+
To clone the nRF52-U2F source code repository from GitHub:
37+
38+
``` sh
39+
git clone --recursive https://github.com/makerdiary/nrf52-u2f
40+
```
41+
42+
## Download the nRF5 SDK
43+
44+
Download the SDK package from [developer.nordicsemi.com](https://developer.nordicsemi.com/).
45+
46+
The current version we are using is `15.2.0`, it can be downloaded directly here: [nRF5_SDK_v15.2.0_9412b96.zip](https://www.nordicsemi.com/eng/nordic/download_resource/59011/94/96002302/116085)
47+
48+
Extract the zip file into the `nrf52-u2f/nrf_sdks/` directory. This should give you the following folder structure:
49+
50+
``` info
51+
./nrf52-u2f/
52+
├── LICENSE.md
53+
├── README.md
54+
├── boards
55+
├── certs
56+
├── docs
57+
├── external
58+
├── firmware
59+
├── include
60+
├── material
61+
├── mkdocs.yml
62+
├── nrf_sdks
63+
│   ├── README.md
64+
│   └── nRF5_SDK_15.2.0_9412b96
65+
├── open_bootloader
66+
├── source
67+
└── tools
68+
```
69+
70+
## Install GNU Arm Embedded Toolchain
71+
72+
Download and install a [GNU ARM Embedded](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm) build for your operating system and extract it on your file system.
73+
74+
!!! note
75+
The current version we are using is `6-2017-q2-update`.
76+
77+
Config the toolchain path in `makefile.windows` or `makefile.posix` depending on platform you are using. That is, the `.posix` should be edited if your are working on either Linux or macOS. These files are located in:
78+
79+
``` sh
80+
<nRF5 SDK>/components/toolchain/gcc
81+
```
82+
83+
Open the file in a text editor and make sure that the `GNU_INSTALL_ROOT` variable is pointing to your GNU Arm Embedded Toolchain install directory. For example:
84+
85+
``` sh
86+
GNU_INSTALL_ROOT := $(HOME)/gcc-arm-none-eabi/gcc-arm-none-eabi-6-2017-q2-update/bin/
87+
GNU_VERSION := 6.3.1
88+
GNU_PREFIX := arm-none-eabi
89+
```
90+
91+
## Generate Attestation Key and Certificate
92+
93+
For more security, remember to generate a new attestation key and certificate.
94+
95+
Change to the `tools` directory, run the `generate-certs.sh` to generate a new attestation key and certificate:
96+
97+
``` sh
98+
$ cd ./nrf52-u2f/tools
99+
100+
$ ./generate-certs.sh
101+
```
102+
103+
If successfully completed, the private key and certificate are stored in `certs/keys.c` file.
104+
105+
## Build the U2F Firmware
106+
107+
Now you are ready to build nRF52-U2F source code.
108+
109+
Open terminal and change directory to:
110+
111+
``` sh
112+
# For nRF52840-MDK board
113+
$ cd ./nrf52-u2f/boards/nrf52840-mdk/armgcc
114+
$ make clean && make
115+
116+
# For nRF52840 Micro Dev Kit USB Dongle
117+
$ cd ./nrf52-u2f/boards/nrf52840-mdk-usb-dongle/armgcc
118+
$ make clean && make
119+
```
120+
121+
The firmware is in the `armgcc/_build/` directory with the name `nrf52840_xxaa.hex`.
122+
123+
![](images/build-u2f-firmware.png)
124+
125+
!!! note
126+
Please follow the [Upgrading Firmware](../upgrading/#upgrade-u2f-firmware-with-nrf-connet-for-desktop) guide to flash the new firmware!
127+
128+
129+
## Build the Open Bootloader
130+
131+
The nRF52-U2F contains a reliable open bootloader, which means that you can update the nRF52-U2F firmware from USB directly without an external programmer needed.
132+
133+
You can build a new bootloader by performing the following steps:
134+
135+
Open terminal and change directory to:
136+
137+
``` sh
138+
# For nRF52840-MDK board
139+
$ cd ./nrf52-u2f/open_bootloader/nrf52840-mdk/armgcc
140+
$ make clean && make
141+
$ make mergehex
142+
143+
# For nRF52840 Micro Dev Kit USB Dongle
144+
$ cd ./nrf52-u2f/open_bootloader/nrf52840-mdk-usb-dongle/armgcc
145+
$ make clean && make
146+
$ make mergehex
147+
```
148+
149+
The bootloader is in the `armgcc/_build/` directory with the name `nrf52840_xxaa_mbr.hex`.
150+
151+
!!! note
152+
Please follow the [Upgrading Firmware](../upgrading/#upgrade-open-bootloader-with-nrfutil) guide to flash the new bootloader!
153+
154+
155+
## Create an Issue
156+
157+
Interested in contributing to this project? Want to report a bug? Feel free to click here:
158+
159+
<a href="https://github.com/makerdiary/nrf52-u2f/issues/new"><button data-md-color-primary="marsala"><i class="fa fa-github"></i> Create an Issue</button></a>
160+

docs/getting-started/index.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Getting Started with nRF52 FIDO U2F Key
2+
3+
This guide shows you how to get started with the nRF52 FIDO U2F Security Key. The following development boards are available to this nRF52-U2F implementation:
4+
5+
| **nRF52840-MDK** | **nRF52840 Micro Dev Kit USB Dongle** |
6+
|:---:|:---:|
7+
| [![](../images/nrf52840-mdk_top.png)](../../nrf52840-mdk/) <a href="https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-iot-development-kit"><button data-md-color-primary="marsala">Get One!</button></a> | [![](../images/nrf52840-mdk-usb-dongle_top.png)](../../nrf52840-mdk-usb-dongle) <a href="https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-usb-dongle"><button data-md-color-primary="marsala">Get One!</button></a> |
8+
9+
If you have already one of these two boards, congratulations, let's go ahead!
10+
11+
So how do you set it up to protect your online service accounts? Follow these easy instructions and you'll set up your nRF52 U2F Key with online services that support FIDO U2F protocol (e.g. Google Account).
12+
13+
## Requirements
14+
15+
* Latest version of Google Chrome browser (or at least version 38) or Opera browser
16+
17+
* [nRF52840-MDK](https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-iot-development-kit) or [nRF52840 Micro Dev Kit USB Dongle](https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-usb-dongle) with the nRF52-U2F firmware
18+
19+
* A Google Account (such as Gmail, Google Docs, YouTube, Google+)
20+
21+
!!! note
22+
If no firmware available, please follow these guides to prepare the correct firmware: [Upgrading the firmware](../upgrading/) or [Building the firmware](../building).
23+
24+
## Setting Up Your Google Account
25+
26+
1. [Turn on 2-Step Verification](https://support.google.com/accounts/answer/9096865?hl=en&visit_id=636755555485133774-251791244&rd=1). If the 2-Step Verification is ON, continue with the next step.
27+
28+
2. [Add the nRF52 U2F Security Key for 2-Step Verification](https://myaccount.google.com/signinoptions/two-step-verification). On **Security Key** option, click **ADD SECURITY KEY**.
29+
30+
![](../guides/images/add-u2f-key-with-google-1.png)
31+
32+
3. Prepare a nRF52 U2F Security Key. Insert your key into your USB port, and press the button on the key when the BLUE LED begins to blink.
33+
34+
![](../guides/images/add-u2f-key-with-google-2.png)
35+
36+
4. Your security key is registered. Enter a name to complete this step.
37+
38+
![](../guides/images/add-u2f-key-with-google-3.png)
39+
40+
3. Set up at least one backup option so that you can sign in even if your other second steps aren't available.
41+
42+
Your U2F Key is now registered to your account as your default 2-Step Verification device!
43+
44+
If you accidentally lose a key, come here and remove that key from your account. No one could log in to your account, though, because they would still need to know your username and password.
45+
46+
## Signing in using your key
47+
48+
Now you can sign in to your Google Account with the security key you add before.
49+
50+
1. On your computer, [sign in to your Google Account](https://accounts.google.com/). Your device will detect that your account has a security key.
51+
52+
2. Insert your key into the USB port in your computer.
53+
54+
![](../guides/images/sign-in-to-google-with-u2f.png)
55+
56+
3. When the BLUE LED begins to blink, press the button on the security key.
57+
58+
**Congratulations!** You can use your key each time you sign in to your Google Account.
59+
60+
## Using with more Services
61+
62+
You will find many more online services that support FIDO U2F, just have a try and enjoy the simplicity of U2F!
63+
64+
* [Using nRF52-U2F with Facebook](../guides/using-u2f-with-facebook)
65+
* [Using nRF52-U2F with Twitter](../guides/using-u2f-with-twitter)
66+
* [Using nRF52-U2F with GitHub](../guides/using-u2f-with-github)
67+
* [Using nRF52-U2F with GitLab](../guides/using-u2f-with-gitlab)
68+
69+
70+
## Create an Issue
71+
72+
Interested in contributing to this project? Want to report a bug? Feel free to click here:
73+
74+
<a href="https://github.com/makerdiary/nrf52-u2f/issues/new"><button data-md-color-primary="marsala"><i class="fa fa-github"></i> Create an Issue</button></a>
75+
Loading
Loading
49.9 KB
Loading
57.8 KB
Loading
39.1 KB
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Using nRF52 U2F Security Key with Facebook
2+
3+
This guide describes how to use the nRF52 U2F Security Key with Facebook.
4+
5+
## Requirements
6+
7+
* Latest version of Google Chrome browser (or at least version 38) or Opera browser
8+
9+
* [nRF52840-MDK](https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-iot-development-kit) or [nRF52840 Micro Dev Kit USB Dongle](https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-usb-dongle) with the nRF52-U2F firmware
10+
11+
* A Facebook Account
12+
13+
!!! note
14+
If no firmware available, please follow these guides to prepare the correct firmware: [Upgrading the firmware](../upgrading/) or [Building the firmware](../building).
15+
16+
## Setting Up Your Facebook Account
17+
18+
1. In Google Chrome or Opera, log in to [Facebook](https://www.facebook.com/).
19+
20+
2. Click the arrow at the top right, and then click **Settings**.
21+
22+
3. In the Security Settings page, in the left pane, click **Security and Login**.
23+
24+
4. Next to **Use two-factor authentication**, click **Edit**.
25+
26+
5. Click **Get Started** button to add extra security with Two-Factor Authentication.
27+
28+
![](images/add-extra-security-to-facebook.png)
29+
30+
6. Select **Authentication App** option, and set up an app like Google Authenticator or Duo Mobile to generate login codes.
31+
32+
7. Follow the instructions on the screen to finish turning on Two-Factor Authentication.
33+
34+
![](images/turn-on-two-factor-authentication-with-facebook.jpg)
35+
36+
8. Next, you are going to add your U2F Key. Under **Add a Backup**, to the right of **Security Keys**, click **Setup**.
37+
38+
![](images/add-security-key-for-facebook.png)
39+
40+
![](images/register-u2f-key-with-facebook.jpg)
41+
42+
9. When the BLUE LED begins to blink, press the button on the key.
43+
44+
![](images/u2f-key-added-for-facebook.jpg)
45+
46+
## Signing in using your key
47+
48+
Now you can sign in to your Facebook account with the security key you add before.
49+
50+
1. On your computer, [sign in to Facebook](https://www.facebook.com/).
51+
52+
2. Insert your security key into the USB port.
53+
54+
![](images/sign-in-to-facebook-with-u2f-1.jpg)
55+
56+
3. When the BLUE LED begins to blink, press the button on the key.
57+
58+
![](images/sign-in-to-facebook-with-u2f-2.jpg)
59+
60+
**Congratulations!** You can use your key each time you sign in to your Facebook account.
61+
62+
## Create an Issue
63+
64+
Interested in contributing to this project? Want to report a bug? Feel free to click here:
65+
66+
<a href="https://github.com/makerdiary/nrf52-u2f/issues/new"><button data-md-color-primary="marsala"><i class="fa fa-github"></i> Create an Issue</button></a>

docs/guides/using-u2f-with-github.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Using nRF52 U2F Security Key with GitHub
2+
3+
This guide describes how to use the nRF52 U2F Security Key with GitHub.
4+
5+
## Requirements
6+
7+
* Latest version of Google Chrome browser (or at least version 38) or Opera browser
8+
9+
* [nRF52840-MDK](https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-iot-development-kit) or [nRF52840 Micro Dev Kit USB Dongle](https://store.makerdiary.com/collections/frontpage/products/nrf52840-mdk-usb-dongle) with the nRF52-U2F firmware
10+
11+
* A GitHub Account
12+
13+
!!! note
14+
If no firmware available, please follow these guides to prepare the correct firmware: [Upgrading the firmware](../upgrading/) or [Building the firmware](../building).
15+
16+
## Configuring two-factor authentication using FIDO U2F
17+
18+
1. You must have already configured 2FA via a TOTP mobile app or via SMS.
19+
20+
2. Download and install [Google Authenticator](https://support.google.com/accounts/answer/1066447?hl=en).
21+
22+
3. Ensure that you have the nRF52 U2F Security Key inserted into your computer.
23+
24+
4. In the upper-right corner of any page, click your profile photo, then click **Settings**.
25+
26+
5. In the user settings sidebar, click **Security**.
27+
28+
6. Next to "Security keys", click **Add**.
29+
30+
7. Under "Security keys", click **Register new device**.
31+
32+
8. Type a nickname for the security key, then click **Add**.
33+
34+
9. When the BLUE LED begins to blink, press the button on the key to have it authenticate against GitHub.
35+
36+
![](images/register-u2f-key-with-github.gif)
37+
38+
39+
## Signing in using your key
40+
41+
Now you can sign in to your GitHub account with the security key you add before.
42+
43+
1. On your computer, [sign in to GitHub](https://github.com/login). Your device will detect that your account has a security key.
44+
45+
2. Insert your security key into the USB port.
46+
47+
3. When the BLUE LED begins to blink, press the button on the key.
48+
49+
![](images/sign-in-to-github-with-u2f.png)
50+
51+
52+
**Congratulations!** You can use your key each time you sign in to your GitHub account.
53+
54+
## Create an Issue
55+
56+
Interested in contributing to this project? Want to report a bug? Feel free to click here:
57+
58+
<a href="https://github.com/makerdiary/nrf52-u2f/issues/new"><button data-md-color-primary="marsala"><i class="fa fa-github"></i> Create an Issue</button></a>

0 commit comments

Comments
 (0)