Skip to content
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
41 changes: 41 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Authorize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
info:
name: Authorize
type: http
seq: 1

http:
method: GET
url: "{{HostUri}}/authorize/?response_type=code&client_id={{ClientIdPermanent}}&state={{State}}&redirect_uri=https://oauthdebugger.com/debug&scope=offline_access read add update delete openid profile email address phone"
params:
- name: response_type
value: code
type: query
- name: client_id
value: "{{ClientIdPermanent}}"
type: query
- name: state
value: "{{State}}"
type: query
- name: redirect_uri
value: https://oauthdebugger.com/debug
type: query
- name: scope
value: offline_access read add update delete openid profile email address phone
type: query

runtime:
scripts:
- type: after-response
code: |-
const redirectUrl = res.getHeader('Location');
if (redirectUrl != null)
{
const urlObj = new URL(redirectUrl);
bru.setVar("AuthorizeCode", urlObj.searchParams.get('code'));
}

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
32 changes: 32 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Client Credentials Flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
info:
name: Client Credentials Flow
type: http
seq: 5

http:
method: POST
url: "{{HostUri}}/token"
headers:
- name: Content-Type
value: application/x-www-form-urlencoded
body:
type: form-urlencoded
data:
- name: client_id
value: "{{ClientIdPermanent}}"
- name: client_secret
value: "{{ClientSecretPermanent}}"
- name: grant_type
value: client_credentials
- name: scope
value: read
auth:
type: basic
username: "{{ClientIdPermanent}}"
password: "{{ClientSecretPermanent}}"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
29 changes: 29 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Device Flow Token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
info:
name: Device Flow Token
type: http
seq: 7

http:
method: POST
url: "{{HostUri}}/token/"
body:
type: form-urlencoded
data:
- name: grant_type
value: urn:ietf:params:oauth:grant-type:device_code
- name: client_id
value: "{{DeviceClientId}}"
- name: scope
value: device_auto
- name: device_code
value: "{{DeviceCode}}"
auth:
type: basic
username: "{{DeviceClientId}}"
password: "{{DeviceClientSecretPermanent}}"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
39 changes: 39 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Device Flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
info:
name: Device Flow
type: http
seq: 6

http:
method: POST
url: "{{HostUri}}/deviceauthorization"
headers:
- name: Content-Type
value: application/x-www-form-urlencoded
body:
type: form-urlencoded
data:
- name: client_id
value: "{{DeviceClientId}}"
- name: client_secret
value: "{{DeviceClientSecretPermanent}}"
- name: scope
value: device_auto

runtime:
scripts:
- type: after-response
code: "// Parse the JSON response body\r

let responseData = res.getBody();\r

\r

// Set the 'RefDeviceCodereshToken' from the response as a collection variable\r

bru.setVar(\"DeviceCode\", responseData.device_code);"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
23 changes: 23 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Introspect.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
info:
name: Introspect
type: http
seq: 8

http:
method: POST
url: "{{HostUri}}/introspect"
body:
type: form-urlencoded
data:
- name: token
value: "{{AccessToken}}"
auth:
type: basic
username: "{{ClientIdPermanent}}"
password: "{{ClientSecretPermanent}}"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
34 changes: 34 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Password Flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
info:
name: Password Flow
type: http
seq: 4

http:
method: POST
url: "{{HostUri}}/token"
headers:
- name: Content-Type
value: application/x-www-form-urlencoded
body:
type: form-urlencoded
data:
- name: client_id
value: "{{ClientIdPermanent}}"
- name: client_secret
value: "{{ClientSecretPermanent}}"
- name: username
value: alice
- name: password
value: secret
- name: grant_type
value: password
- name: scope
value: read
auth:
type: basic

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
50 changes: 50 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Refresh Token Flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
info:
name: Refresh Token Flow
type: http
seq: 3

http:
method: POST
url: "{{HostUri}}/token/"
body:
type: form-urlencoded
data:
- name: grant_type
value: refresh_token
- name: client_id
value: "{{ClientIdPermanent}}"
- name: refresh_token
value: "{{RefreshToken}}"
- name: redirect_uri
value: https://oauthdebugger.com/debug
- name: scope
value: offline_access read add update delete openid profile email address phone
auth:
type: basic
username: "{{ClientIdPermanent}}"
password: "{{ClientSecretPermanent}}"

runtime:
scripts:
- type: after-response
code: "// Parse the JSON response body\r

let responseData = res.getBody();\r

\r

// Set the 'RefreshToken' from the response as a collection variable\r

bru.setVar(\"RefreshToken\", responseData.refresh_token);\r

\r

// Set the 'AccessToken' from the response as a collection variable\r

bru.setVar(\"AccessToken\", responseData.access_token);"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
25 changes: 25 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Revoke Access Token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
info:
name: Revoke Access Token
type: http
seq: 9

http:
method: POST
url: "{{HostUri}}/revoke"
body:
type: form-urlencoded
data:
- name: token
value: "{{AccessToken}}"
- name: token_hint
value: access_token
auth:
type: basic
username: "{{ClientIdPermanent}}"
password: "{{ClientSecretPermanent}}"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
25 changes: 25 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Revoke Refresh Token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
info:
name: Revoke Refresh Token
type: http
seq: 10

http:
method: POST
url: "{{HostUri}}/revoke"
body:
type: form-urlencoded
data:
- name: token
value: "{{RefreshToken}}"
- name: token_hint
value: refresh_token
auth:
type: basic
username: "{{ClientIdPermanent}}"
password: "{{ClientSecretPermanent}}"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
44 changes: 44 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/Token.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
info:
name: Token
type: http
seq: 2

http:
method: POST
url: "{{HostUri}}/token/"
body:
type: form-urlencoded
data:
- name: grant_type
value: authorization_code
- name: client_id
value: "{{ClientIdPermanent}}"
- name: code
value: "{{AuthorizeCode}}"
- name: redirect_uri
value: https://oauthdebugger.com/debug
- name: scope
value: offline_access read add update delete openid profile email address phone
auth:
type: basic
username: "{{ClientIdPermanent}}"
password: "{{ClientSecretPermanent}}"

runtime:
scripts:
- type: after-response
code: |-
// Parse the JSON response body
let responseData = res.getBody();

// Set the 'RefreshToken' from the response as a collection variable
bru.setVar("RefreshToken", responseData.refresh_token);

// Set the 'AccessToken' from the response as a collection variable
bru.setVar("AccessToken", responseData.access_token);

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
25 changes: 25 additions & 0 deletions bruno/Shark.OAuth2.0/Access Token/folder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
info:
name: Access Token
type: folder
seq: 1

request:
auth:
type: oauth2
flow: authorization_code
authorizationUrl: https://localhost:7000/login?returnurl=authorize%2f%3fresponse_type%3dcode%26client_id%3dclient-1%26redirect_uri%3dhttps%253a%252f%252flocalhost%253a9001%252fcallback%26state%3dd743f82481cb406b91b8ec540f2d53e0
accessTokenUrl: https://localhost:7000/token
callbackUrl: https://localhost:9001/callback
credentials:
clientId: "{{ClientIdPermanent}}"
clientSecret: "{{ClientSecretPermanent}}"
placement: basic_auth_header
state: da150dde94be049ee86e8adf876f4b426
pkce:
disabled: true
tokenConfig:
placement:
header: ""
settings:
autoFetchToken: true
autoRefreshToken: false
17 changes: 17 additions & 0 deletions bruno/Shark.OAuth2.0/Client Registration/Client Delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
info:
name: Client Delete
type: http
seq: 4

http:
method: DELETE
url: "{{HostUri}}/register/{{ClientId}}"
auth:
type: bearer
token: "{{RegistrationAccessToken}}"

settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
Loading