forked from EirikHaughom/self-managed-osdu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auth-token.http
44 lines (36 loc) · 1.11 KB
/
auth-token.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
# -------HTTP REST CLIENT -------
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
@login_base = login.microsoftonline.com/{{TENANT_ID}}
@oauth_token_host = {{login_base}}/oauth2/v2.0/token
@scopes = {{CLIENT_ID}}/.default openid profile offline_access
@AUTH_CODE =
# -----------------------
# OAUTH authorization_code
# -----------------------
###
# @name authorize
POST https://{{oauth_token_host}} HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&redirect_uri=https://{{OSDU_HOST}}/login/
&client_id={{CLIENT_ID}}
&client_secret={{CLIENT_SECRET}}
&scope={{scopes}}
&code={{AUTH_CODE}}
# -----------------------
# OAUTH refresh_token
# -----------------------
###
# @name refresh
POST https://{{oauth_token_host}} HTTP/1.1
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&client_id={{CLIENT_ID}}
&client_secret={{CLIENT_SECRET}}
&refresh_token={{authorize.response.body.refresh_token}}
&scope={{scopes}}
# -----------------------
# API (Variables)
# -----------------------
###
@access_token = {{refresh.response.body.access_token}}