Skip to content

Commit 01052cf

Browse files
Josh BrandoffJosh Brandoff
authored andcommitted
Cleaned up README
1 parent 784cad6 commit 01052cf

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

README.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,36 @@
1-
yoloAPI
2-
===================================================================
3-
An flask-oauthlib server example for 'Resource Owner Password Credentials Grant'
1+
# Yolo API
2+
3+
This is a Flask-OAuthlib server example for the 'Resource Owner Password Credentials Grant' described in [RFC 6749 (Section 1.3.3)](http://tools.ietf.org/html/rfc6749#section-1.3.3).
4+
5+
## Deployment
6+
7+
Clone this repository and install all dependencies:
48

5-
##### Get it up and running
6-
To get it up and running clone this repository and install the dependencies.
79
```bash
8-
pip install -r requirements.txt
10+
$ pip install -r requirements.txt
911
```
10-
After this you can run the application with `python app.py`.
1112

12-
##### Management
13-
At this point you should to go `http://localhost:5000` and generate a client and also create a user.
14-
Now you can use `curl` for testing the application and the access the protected resource.
13+
Once all dependencies are installed, you may run the application with `python app.py`.
14+
15+
## User and Client Management
16+
17+
For the example to work properly, you will need to create a client and user. You can create users and clients through the management interface available at [http://localhost:5000](http://localhost:5000).
1518

16-
##### Get a Bearer token
19+
## Testing
20+
21+
After creating a user and client, you may use curl to test the application.
22+
23+
### Generating a Bearer Token
1724

1825
```bash
1926
curl -X POST -d "client_id=9qFbZD4udTzFVYo0u5UzkZX9iuzbdcJDRAquTfRk&grant_type=password&username=jonas&password=pass" http://localhost:5000/oauth/token
2027
{"access_token": "NYODXSR8KalTPnWUib47t5E8Pi8mo4", "token_type": "Bearer", "refresh_token": "s6L6OPL2bnKSRSbgQM3g0wbFkJB4ML", "scope": ""}
2128
```
2229

23-
##### Use the Bearer token to access the protected resource
30+
### Accessing a Protected Resource Using Retrieved Bearer Token
31+
2432
```bash
2533
curl -H "Authorization: Bearer NYODXSR8KalTPnWUib47t5E8Pi8mo4" http://localhost:5000/yolo
26-
YOLO!!! You made it through and accessed the protected resource
34+
YOLO! Congraulations, you made it through and accessed the protected resource!
2735
```
36+

0 commit comments

Comments
 (0)