Grant type 'client_credentials' not allowed for the client

Hey guys. I have been stuck in an unwanted flow. I am using a SPA for the front end. When the SPA calls the token api for auth access_token, it gives me the token, now I need to pass that token to my backend (nestJS) and do some work there. But I am getting this error. Can anyone please help .

Screenshot 2022-10-12 at 6.22.26 PM

Hello @bilal welcome to the community!

Where exactly are you getting this error? From your code it looks like the token endpoint (oauth/token)?

Typically this error is spot on, that is whatever client is requesting the token (in this case your SPA) using client credentials doesn’t support the grant type. Client credentials are only used for confidential applications like M2M.

Keep us posted!

Hey .
Yes that was helpful. I had to create a separate application for my backend which was an M2M app.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.