Getting authsdk Error: Client ID must be specified

Hi Team,

I am getting below error

AuthSdkError: A clientId must be specified in the OktaAuth constructor to get a token

Can anyone please help here ?

Hi @er.gauravgoyal. Which SDK are you using, and which version?

1 Like

Hey @louie : I am using below npm packages
@okta/okta-auth-js”: “^6.7.1”,
@okta/okta-react”: “^6.5.0”,

Hi @er.gauravgoyal! Double checking, did you add a client id to your OktaAuth constructor per - GitHub - okta/okta-react: Okta OIDC SDK for React.

import { useHistory } from 'react-router-dom';
import { OktaAuth, toRelativeUrl } from '@okta/okta-auth-js';

const oktaAuth = new OktaAuth({
  issuer: 'https://{yourOktaDomain}/oauth2/default',
  clientId: '{clientId}',
  redirectUri: window.location.origin + '/login/callback'
});
1 Like

Hey,
I have the oktaAuth object defined like above and I’m still getting the error on my Cloud Build instance. Any idea why? It is also a new error. We weren’t facing this issue until yesterday and no configurations have been changed as far as I am aware.