30 lines
631 B
Plaintext
30 lines
631 B
Plaintext
meta {
|
|
name: Auth
|
|
type: http
|
|
seq: 5
|
|
}
|
|
|
|
get {
|
|
url:
|
|
body: none
|
|
auth: oauth2
|
|
}
|
|
|
|
auth:oauth2 {
|
|
grant_type: authorization_code
|
|
callback_url: https://localhost:1234
|
|
authorization_url: {{keycloak_host}}/realms/{{keycloak_realm}}/protocol/openid-connect/auth
|
|
access_token_url: {{keycloak_host}}/realms/{{keycloak_realm}}/protocol/openid-connect/token
|
|
client_id: casket
|
|
client_secret:
|
|
scope:
|
|
state:
|
|
pkce: false
|
|
}
|
|
|
|
script:post-response {
|
|
bru.setVar('access_token', res.body.access_token);
|
|
const atob = require('atob');
|
|
bru.setVar('user_id',JSON.parse(atob(res.body.access_token.split('.')[1])).sub)
|
|
}
|