Skip to content

Commit 10a1074

Browse files
author
Rajith
committed
change readme
1 parent 1a1b753 commit 10a1074

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,37 @@
1+
# Build and Run
2+
```java
3+
mvn clean install -DskipTests spring-boot:run
4+
```
5+
# Usage
6+
### Checking app is deployed sucessfullly
7+
```sh
18
curl -i http://localhost:9191/api/hello
29
Hello User!
3-
10+
```
11+
### Acess secure resource with token
12+
```sh
413
curl -i http://localhost:9191/api/secure
14+
515
{"timestamp":1444985908768,"status":401,"error":"Unauthorized","message":"Access Denied","path":"/api/secure"}
16+
```
617

18+
### Fetching refresh_token
19+
```sh
720
curl -vu rajithapp:secret 'http://localhost:9191/api/oauth/token?username=admin&password=admin&grant_type=password'
21+
822
{"access_token":"91202244-431f-444a-b053-7f50716f2012","token_type":"bearer","refresh_token":"e6f8624f-213d-4343-a971-980e83f734be","expires_in":1738,"scope":"read write"}
23+
```
924

25+
### Fetching acess_token by submitting refresh_token
26+
```sh
1027
curl -vu rajithapp:secret 'http://localhost:9191/api/oauth/token?grant_type=refresh_token&refresh_token=<refresh_token>'
28+
1129
{"access_token":"821c99d4-2c9f-4990-b68d-18eacaff54b2","token_type":"bearer","refresh_token":"e6f8624f-213d-4343-a971-980e83f734be","expires_in":1799,"scope":"read write"}
30+
```
1231

32+
### Access secure resource sucessfully
33+
```sh
1334
curl -i -H "Authorization: Bearer <access_token>" http://localhost:9191/api/secure
35+
36+
Secure Hello!
37+
```

0 commit comments

Comments
 (0)