-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathREST.http
52 lines (43 loc) · 1.93 KB
/
REST.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
@baseUrl = https://global-keycloak.azurewebsites.net/auth/realms/master/protocol/openid-connect
###################################################################################
#### openid configuration
GET https://global-keycloak.azurewebsites.net/auth/realms/master/.well-known/openid-configuration HTTP/1.1
Content-Type: application/json
###################################################################################
### AUTH sign in
# @name sign_in
POST {{baseUrl}}/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=password
&client_id=aspnetcore-keycloak
&client_secret=1beb5df9-01dd-46c3-84a8-b65eca50ad57
&resource=aspnetcore-keycloak
&username=guest
&password=guest
&scope=openid
@access_token = {{sign_in.response.body.$.access_token}}
@refresh_token = {{sign_in.response.body.$.refresh_token}}
###################################################################################
### AUTH get user info
GET {{baseUrl}}/userinfo HTTP/1.1
Authorization: Bearer {{access_token}}
Content-Type: application/json
###################################################################################
### AUTH refresh token https://identitymodel.readthedocs.io/en/latest/client/token.html#requesting-a-token-using-the-refresh-token-grant-type
POST {{baseUrl}}/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&client_id=aspnetcore-keycloak
&client_secret=1beb5df9-01dd-46c3-84a8-b65eca50ad57
&resource=aspnetcore-keycloak
&refresh_token={{refresh_token}}
###################################################################################
### API get values (BEARER)
GET https://localhost:5001/api/values HTTP/1.1
Authorization: Bearer {{access_token}}
Content-Type: application/json
###################################################################################
### API get root (BEARER)
GET https://localhost:5001 HTTP/1.1
Authorization: Bearer {{access_token}}
Content-Type: application/json