Skip to content

Commit

Permalink
Merge pull request #14 from VirgilSecurity/develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrenkoAnton authored Feb 27, 2019
2 parents 92824ed + 8da5356 commit feffd1b
Showing 1 changed file with 15 additions and 38 deletions.
53 changes: 15 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ PHE is a new, more secure mechanism that protects user passwords and lessens the


## Register Your Account
Before starting practicing with the SDK and usage examples be sure that:
- you have a registered passw0rd Account
- you created passw0rd Application
- and you got your passw0rd application's credentials, such as: Application Access Token, Service Public Key, Client Secret Key

If you don't have an account or a passw0rd project with its credentials, please use the [passw0rd CLI](https://github.com/passw0rd/cli) to get it.
Before starting practicing with the SDK and usage examples make sure that:
- you have a registered at [Virgil Dashboard](https://dashboard.virgilsecurity.com/)
- you created an application for the Passw0rd use case
- and you got your passw0rd application's credentials such as: `App Secret Key`, `Service Public Key`, `App Token`


## Install and Configure SDK
The passw0rd PHP SDK is provided as a package named `passw0rd/sdk-php`. The package is distributed via Composer. The
package
is available for PHP 7.0 or newer.
The passw0rd PHP SDK is provided as a package named `passw0rd/sdk-php`. The package is distributed via Composer. The package is available for PHP 7.0 or newer.


### Install SDK Package
Expand All @@ -54,7 +50,7 @@ package

Also, you can launch the *extension/helper.php* file to get information about a version and extensions.

now, install passw0rd SDK library with the following code:
Now, install passw0rd SDK library with the following code:
```bash
composer require passw0rd/sdk-php
```
Expand All @@ -68,7 +64,7 @@ SDK configuration .env file:
APP_TOKEN=
SERVICE_PUBLIC_KEY=
APP_SECRET_KEY=
UPDATE_TOKEN= //need to be empty
UPDATE_TOKEN= //must be empty
```

Here is an example of how to specify your credentials SDK class instance:
Expand Down Expand Up @@ -213,28 +209,9 @@ Also, use this flow in case your database has been COMPROMISED!
There is how it works:

**Step 1.** Get your `UPDATE_TOKEN` using [Passw0rd CLI](https://github.com/passw0rd/cli)

- be sure you're logged in your account. To log in the account use the following command (2FA is required):

```bash
// FreeBSD / Linux / Mac OS
./passw0rd login my@email.com
**Step 1.** Get your `UPDATE_TOKEN` using [Virgil Dashboard](https://dashboard.virgilsecurity.com)

// Windows OS
passw0rd login my@email.com
```

- then, use the `rotate` command and your application token to get an `UPDATE_TOKEN`:

```bash
// FreeBSD / Linux / Mac OS
./passw0rd application rotate <app_token>

// Windows OS
passw0rd application rotate <app_token>
```
as a result, you get your `UPDATE_TOKEN`.
Move to your Application panel and press “Show update token” button to get the `update_token`.

**Step 2.** Initialize passw0rd SDK with the `UPDATE_TOKEN`
Move to passw0rd SDK configuration .env file and specify your `UPDATE_TOKEN`:
Expand Down Expand Up @@ -273,14 +250,14 @@ Since the SDK is able to work simultaneously with two versions of user's records

**Step 4.** Get a new `APP_SECRET_KEY` and `SERVICE_PUBLIC_KEY` of a specific application

Use passw0rd CLI `update-keys` command and your `UPDATE_TOKEN` to update the `APP_SECRET_KEY` and `SERVICE_PUBLIC_KEY`:
Use Virgil CLI `update-keys` command and your `UPDATE_TOKEN` to update the `APP_SECRET_KEY` and `SERVICE_PUBLIC_KEY`:

```bash
// FreeBSD / Linux / Mac OS
./passw0rd application update-keys <service_public_key> <app_secret_key> <update_token>
./virgil passw0rd update-keys <service_public_key> <app_secret_key> <update_token>

// Windows OS
passw0rd application update-keys <service_public_key> <app_secret_key> <update_token>
virgil passw0rd update-keys <service_public_key> <app_secret_key> <update_token>
```

**Step 5.** Move to passw0rd SDK configuration .env file and replace your previous `APP_SECRET_KEY`,
Expand All @@ -296,7 +273,7 @@ UPDATE_TOKEN= //must be empty


## Docs
* [Passw0rd][_passw0rd] home page
* [Virgil Dashboard](https://dashboard.virgilsecurity.com)
* [The PHE WhitePaper](https://virgilsecurity.com/wp-content/uploads/2018/11/PHE-Whitepaper-2018.pdf) - foundation principles of the protocol

## License
Expand All @@ -306,6 +283,6 @@ This library is released under the [3-clause BSD License](LICENSE.md).
## Support
Our developer support team is here to help you. Find out more information on our [Help Center](https://help.virgilsecurity.com/).

Also, get extra help from our support team: support@VirgilSecurity.com.
You can find us on [Twitter](https://twitter.com/VirgilSecurity) or send us email support@VirgilSecurity.com.

[_passw0rd]: https://passw0rd.io/
Also, get extra help from our support team on [Slack](https://virgilsecurity.com/join-community).

0 comments on commit feffd1b

Please sign in to comment.