SweetConnect LogoSweetConnect

Obtaining the Access Token

To get an access token, you need to send a POST request to the token endpoint. The request must use the application/x-www-form-urlendcoded content type and include the following parameters:

  • grant_type: set this to password
  • client_id: the client identifier, in this case, sweetconnect
  • user_name: your username
  • password: your corresponding password
  • scope: the requested scope, here it is openid
curl -X POST --location "https://iam.my.sweetconnect.io/realms/sweetconnect-prod/protocol/openid-connect/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=password&client_id=sweetconnect&username=${USERNAME}&password=${PASSWORD}&scope=openid"

If the credentials are valid, the server will respond with a JSON payload that includes an access_token, a refresh_token, and other details such as the token's expiration time.