Bruno Script for AccessToken generation

Could someone share a working Bruno script for token generation?

I have tried many scripts but nothing was working

Thanks!

please refer these article json - Bruno API: Pre-request script to generate access_token automatically - Stack Overflow

@selvasanthosh did you tried this PowerShell -

$tenant = “”
$clientId = “<CLIENT_ID>”
$clientSecret = “<CLIENT_SECRET>”

$body = @{
grant_type = “client_credentials”
client_id = $clientId
client_secret = $clientSecret
}

$response = Invoke-RestMethod -Method Post
-Uri “https://$tenant.api.identitynow.com/oauth/token” -ContentType "application/x-www-form-urlencoded"
-Body $body

$accessToken = $response.access_token
$accessToken

-mahesh

After upgrading to Bruno 2.x or 3.x you don’t need to have a script. It can be directly configured in the UI.

Simplest is to configure it on collection level and inherit the authentication settings in the operations.

Please take a look at: OAuth 2.0 Configuration | Bruno Docs

– Remold