Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix passport personal access token client creation #2718

Merged
merged 2 commits into from
May 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions docs/installation/generic.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Run this command:

```sh
php artisan passport:keys
php artisan passport:client --personal --no-interaction
```

This command will generate encryption keys in the `storage` directory.
Expand All @@ -220,13 +221,13 @@ Instead of keeping the encryption keys as files, you can add them as environment
```sh
sed ':a;N;$!ba;s/\n/\\n/g' storage/oauth-private.key
```
Copy the output to environment variable called `PASSPORT_PRIVATE_KEY` in your `.env` file
Copy the output to an environment variable called `PASSPORT_PRIVATE_KEY` in your `.env` file

* Do the same thing with the contents of the public key:
```sh
sed ':a;N;$!ba;s/\n/\\n/g' storage/oauth-public.key
```
copying its contents to an environment variable called `PASSPORT_PUBLIC_KEY`
Copy ths output to an environment variable called `PASSPORT_PUBLIC_KEY` in your `.env` file


#### Optional: Generate a Password grant client
Expand All @@ -244,9 +245,9 @@ Client ID: 5
Client secret: zsfOHGnEbadlBP8kLsjOV8hMpHAxb0oAhenfmSqq
```

* Copy the two values into two new environment variable of your `.env` file:
- The value of client ID in a `MOBILE_CLIENT_ID` variable
- The value of client secret in a `MOBILE_CLIENT_SECRET` variable
* Copy the two values into two new environment variables of your `.env` file:
- The value of `Client ID` in a `MOBILE_CLIENT_ID` variable
- The value of `Client secret` in a `MOBILE_CLIENT_SECRET` variable

* OAuth login can be access on `http://localhost/oauth/login`.

Expand Down
12 changes: 8 additions & 4 deletions docs/installation/heroku.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,32 @@ heroku run bash -a <APP-ID>
* Run
```sh
php artisan passport:keys
php artisan passport:client --personal --no-interaction
```

This command will generate encryption keys in the `storage` directory.
The two keys `oauth-private.key` and `oauth-public.key` cannot be backup and recreate in heroku directly.

* Still in the Heroku CLI, run this command to output the private key:
```
```sh
sed ':a;N;$!ba;s/\n/\\n/g' ~/storage/oauth-private.key
```
Copy the output to a new Heroku environment variable called `PASSPORT_PRIVATE_KEY`

* Do the same thing with the contents of the public key:
```
```sh
sed ':a;N;$!ba;s/\n/\\n/g' ~/storage/oauth-public.key
```
Copy its contents to an environment variable called `PASSPORT_PUBLIC_KEY`
Copy its contents to a new Heroku environment variable called `PASSPORT_PUBLIC_KEY`


Once Heroku is re-deploy, you should be able to use the 'Create new token' function in https://XXX.herokuapp.com/settings/api

Once you have the token, you can use the API with a command line:
```
curl -H "Authorization: Bearer eyJ0eXIh7ARV1Xjcf4qNo" https://XXX.herokuapp.com/api
curl -H "Authorization: Bearer API_TOKEN" https://XXX.herokuapp.com/api
```

If everything is well, this call will return:
```json
{"success":{"message":"Welcome to Monica"}}
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Note: while the .com version has a paid plan, there is no limitations on Monica

If you want to host it yourself, you need

* PHP 7.1+ or newer
* PHP 7.2+ or newer
* HTTP server with PHP support (eg: Apache, Nginx, Caddy)
* Composer
* MySQL
Expand Down Expand Up @@ -246,6 +246,6 @@ Monica use a lot of open source projects and we thank them with all our hearts.

## License

Copyright (c) 2016-2018
Copyright (c) 2016-2019

Licensed under the AGPL License. [View license](/LICENSE).