2025-06-14 15:09:26 +02:00
|
|
|
# Login into account
|
2024-11-28 12:47:00 +01:00
|
|
|
POST {{ base_url }}/login
|
|
|
|
|
[FormParams]
|
|
|
|
|
login: root
|
|
|
|
|
password: root
|
|
|
|
|
HTTP 303
|
|
|
|
|
[Captures]
|
|
|
|
|
user_jwt: cookie "minauthator_jwt"
|
|
|
|
|
[Asserts]
|
|
|
|
|
cookie "minauthator_jwt" exists
|
|
|
|
|
cookie "minauthator_jwt[Value]" contains "eyJ0"
|
|
|
|
|
cookie "minauthator_jwt[SameSite]" == "Lax"
|
|
|
|
|
|
2025-06-14 15:09:26 +02:00
|
|
|
# Assert that we have currently no authorizations
|
2024-11-28 12:47:00 +01:00
|
|
|
GET {{ base_url }}/me/authorizations
|
|
|
|
|
HTTP 200
|
|
|
|
|
[Asserts]
|
|
|
|
|
xpath "string(///h1)" == "Your authorizations"
|
|
|
|
|
xpath "string(///i)" == "You didn't authorized or accessed any applications for now."
|
|
|
|
|
|
|
|
|
|
# OAuth2 implicit flow (pre-granted app)
|
|
|
|
|
GET {{ base_url }}/authorize
|
|
|
|
|
[QueryStringParams]
|
|
|
|
|
client_id: 00000001-0000-0000-0000-000000000001
|
|
|
|
|
response_type: code
|
|
|
|
|
redirect_uri: http://localhost:9090/callback
|
|
|
|
|
state: Afk4kf6pbZkms78jM
|
|
|
|
|
scope: user_read_basic
|
|
|
|
|
HTTP 302
|
|
|
|
|
[Captures]
|
|
|
|
|
authorization_code: header "Location" regex "\\?code=(.*)&"
|
|
|
|
|
|
|
|
|
|
# OAuth2 get access token
|
|
|
|
|
POST {{ base_url }}/api/token
|
|
|
|
|
[BasicAuth]
|
|
|
|
|
00000001-0000-0000-0000-000000000001: dummy_client_secret
|
|
|
|
|
[FormParams]
|
|
|
|
|
code: {{ authorization_code }}
|
|
|
|
|
scope: user_read_basic
|
|
|
|
|
redirect_uri: http://localhost:9090/callback
|
|
|
|
|
grant_type: authorization_code
|
|
|
|
|
HTTP 200
|
|
|
|
|
[Captures]
|
|
|
|
|
access_token: jsonpath "$.access_token"
|
|
|
|
|
|
2025-06-14 15:09:26 +02:00
|
|
|
# Asserts that the new authorization is listed
|
2024-11-28 12:47:00 +01:00
|
|
|
GET {{ base_url }}/me/authorizations
|
|
|
|
|
HTTP 200
|
|
|
|
|
[Asserts]
|
|
|
|
|
xpath "string(///h1)" == "Your authorizations"
|
|
|
|
|
xpath "string(///main/ul/li)" contains "UserReadBasic"
|
|
|
|
|
|