SAML SSO vs OAuth: Client Credentials flow failing after SAML migration

Just finished migrating our org to SAML SSO. The UI login works fine, agents are authenticating via Okta without issues. But now my Node.js service that relies on the genesys-cloud SDK is failing to get a token.

I’m using the OAuthApiClient with the client credentials grant. The code hasn’t changed, but the response is now a 403 Forbidden.

const oauthApiClient = new genesys_cloud.Auth.OAuthApiClient();
const token = await oauthApiClient.postOAuthToken({
 body: {
 grant_type: 'client_credentials',
 client_id: process.env.GC_CLIENT_ID,
 client_secret: process.env.GC_CLIENT_SECRET,
 scope: 'admin:api:read'
 }
});

The error payload is cryptic:

{
 "errors": [
 {
 "code": "UNAUTHORIZED",
 "message": "The provided credentials are invalid or the client is not authorized for this grant type."
 }
 ]
}

I checked the application settings in Genesys Cloud. The client ID and secret are correct. The application is still marked as ‘Confidential’. I assumed SAML only affects user login, not machine-to-machine auth. But maybe SAML enforcement broke the client credentials flow?

I tried switching to the authorization code flow with a dummy user, but that requires a browser redirect which my backend service can’t handle. I need a programmatic way to get a bearer token without user interaction.

Is there a specific permission I need to enable on the application after enabling SAML? Or is the SDK outdated for this scenario? I’ve been digging through the API docs for an hour and found nothing linking SAML settings to OAuth client restrictions. It feels like a config issue on the Genesys side, but I can’t find the toggle.