Skip to content

Commit

Permalink
PAS156: Update README.md to point to 1.1.0. (#10)
Browse files Browse the repository at this point in the history
* PAS156: Update README.md to point to 1.1.0.

* PAS156: Publish requested changes

* api -> apiUrl and added origin/rpid

---------

Co-authored-by: Anders Åberg <[email protected]>
  • Loading branch information
jonashendrickx and abergs authored Aug 24, 2023
1 parent dcc90bf commit baee0ee
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
dist
.vscode
.DS_STORE
.DS_STORE
.idea
68 changes: 55 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,110 @@


![passwordless by bitwarden](./Screenshot%202023-04-28%20at%2011.50.52%20AM%20(2).png)

Welcome to Passwordless.dev by Bitwarden. Passwordless.dev is a software toolkit that helps developers bring FIDO2 WebAuthn passkeys to their end users. Provide passwordless authentication without the need to read W3C spoecification documentation, determine cryptography, or manage stored public keys. Passwordless with Bitwarden does this for you.

## Get started

Passwordless.dev consists of three key parts:

* An open-source client side library, used by your frontend to make requests to the end-user's browser WebAuthn API and requests to the passwordless.dev APIs.
* A public RESTful API used to compelte FIDO2 WebAuthn cryptographic exchanges with the browser.
* A public RESTful API used to complete FIDO2 WebAuthn cryptographic exchanges with the browser.
* a private RESTful API used to initiate key registrations, verify signins, and retrieve keys for end-users.

To start, download the Passwordless.js library:

#### NPM package

Install the Passwordless.dev JS client:

```console
yarn add @passwordlessdev/passwordless-client
```

Next, your front end must import the libary to call the methods:
Or:

```console
npm install @passwordlessdev/passwordless-client
```

Next, your front end must import the library to call the methods:

```js
import { Client } from '@passwordlessdev/passwordless-client';
const p = new Client({apiKey: ""});
```

#### HTML

Install the Passwordless.dev JS client:

```html
<script src="https://cdn.passwordless.dev/dist/0.4.0/passwordless.iife.js" crossorigin="anonymous"></script>`
<script src="https://cdn.passwordless.dev/dist/1.1.0/passwordless.iife.js" crossorigin="anonymous"></script>`
```

Next, your front end must import the libary to call the methods:

```html
<script>
const p = new Passwordless.Client({});
const p = new Passwordless.Client({apiKey: ""});
</script>
```

Registering a token could look like:

```javascript
// Instantiate a passwordless client using your API public key.
const p = new Passwordless.Client({
apiKey: "myapplication:public:4364b1a49a404b38b843fe3697b803c8"
});

// Fetch the registration token from the backend.
const backendUrl = "https://localhost:8002";
const registerToken = await fetch(backendUrl + "/create-token?userId" + userId).then(r => r.json());

// Register the token with the end-user's device.
const { token, error } = await p.register(registerToken);
```

## Advanced configuration

When selfhosting, the `apiUrl` property in the constructor can be used to configure the URL for the Passwordless.dev server.

For advanced usages, you can also configure the `origin` and the `rpid`.

## Build the library

Run:

```console
yarn build
```

## Get API credentials
Passwordless.dev's Admin Panel is a GUI for application and API key management. You can manage your users and receive your `publicKey` and `apiSecret` from the interface.
## Obtaining your API credentials

Passwordless.dev's Admin Panel is a GUI for application and API key management. You can manage your users and receive your `public API key` and `private API key` (also known as secret) from the user interface.

To create an application, follow the instructions [here](https://docs.passwordless.dev/).

Register at [with the admin console](https://adminconsole-devtest.azurewebsites.net/Account/Login)
To create an account for yourself or your organization, visit [this link](https://admin.passwordless.dev/signup)

## Next steps

1. Call the function `register` or (e.g. `signinWithDiscoverable()`).
2. Add two endpoints to your backend that integrate to your ecisting user system (*set cookie, sessions, and more*) and will communicate secrets with our API.
3. Make a reques request between your clientside code and the verification endpoints on your backend to verify the registration or sign in.
2. Add two endpoints to your backend that integrate to your existing user system (*set cookie, sessions, and more*) and will communicate secrets with our API.
3. Make a request between your clientside code and the verification endpoints on your backend to verify the registration or sign in.

Now that your libary has been built and you can run passwordless, review the Passwordless.dev [docs](https://docs.passwordless.dev/guide/) for additional infomraiton including alternitive language integrations, admin console management, and more!
We've written a more detailed guide, with more language examples and SDKs in the [Passwordless.dev](https://docs.passwordless.dev/guide/) documentation.

## Help

To talk to the passwordless team, send us an email at [email protected]

## References
- [Using the JavaScript client](https://docs.passwordless.dev/guide/frontend/javascript.html)

## Bitwarden
You can fine Bitwarden's other code repositories at https://github.com/bitwarden and more infomration on https://bitwarden.com/.

You can fine Bitwarden's other code repositories at https://github.com/bitwarden and more information on https://bitwarden.com/.

## Contribute

Expand Down

0 comments on commit baee0ee

Please sign in to comment.