The error you are seeing indicates to me that the OIDC application within Okta that you created (where you got your clientId from) does not have the necessary Grant Type configured, resulting in this error. Based on the error message, it sounds like you only have the Implicit grant type (both ID Token and Access Token) enabled for this client.
However, the guide you were following indicates that you need to have Authorization Code flow enabled. We can confirm this is the correct grant type, as the config you included has “pkce: true,” which is referring to the Authorization Code flow w/ PKCE.
Can you check your application configuration in Okta and ensure that you enable the Authorization Code flow as an “Allowed grant type?”
Thank you for your reply, your diagnosis was 100% correct, after I enabled Authorization Code on the Okta dashboard, it authenticates Ok, Upon clicking the Login button, it redirects to my Okta login page, and upon correct combo of username / pwd , I am back at the React app, with a Logout button.
However, “the guide I was following” as per your reply, is not the actual guide I was following.
See my screenshot. I obtained the guide from the “Dashboard”, and jumped straight to the React guide.
Nowhere did it mention I needed to enable Authorization Code.
Yours,
Totally frustrated, a beginner to the platform needs to have a better on-boarding experience.
Update: I stand corrected, it does indeed show “Allowed grant types Authorization Code” in the Setting + Value table
My problem was that I created the SPA App at a different time, and when following the guide, i ignored that part, as I had already created it earlier.
Yup, that was the section of the guide I was trying to directly link to, but it looks like it didn’t work as I expected. Sorry about that!
I hope that, with you resolving your error, others who run into it will be able to handle their own response type errors with a little less frustration.