Appearance
API Client Authentication
For automated API client authentication (machine-to-machine), use the client_credentials grant type to retrieve a bearer token from the token endpoint: https://auth.private.cloud.swisscom.ch/realms/CMPNext/protocol/openid-connect/token. This requires an API Client which provides a client_id and client_secret.
Replace ... with your specific client_id and client_secret in the command below:
bash
# Target URL: https://auth.private.cloud.swisscom.ch/realms/CMPNext/protocol/openid-connect/token
curl --location 'https://auth.private.cloud.swisscom.ch/realms/CMPNext/protocol/openid-connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=...' \
--data-urlencode 'client_secret=...'The response will contain an access_token (JWT) which should be sent as a Bearer token in the Authorization header for subsequent API calls: Authorization: Bearer <token>.
TIP
You can decode the retrieved access_token on jwt.io to inspect its claims.
