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 topasswordclient_id: the client identifier, in this case,sweetconnectuser_name: your usernamepassword: your corresponding passwordscope: the requested scope, here it isopenid
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.