myoufM
ZITADEL•13mo ago
myouf

Getting `unauthorized_client` error while introspecting token from NestJS API

Hello everyone šŸ‘‹ I'm trying to implement authentication via Zitadel on a NestJS REST API, like on this example repo. On the Zitadel side, I have a project with two apps:
  • one with ā€œAPIā€ type, with JWT private key authentication (dedicated to the NestJS API)
  • one with ā€œUser Agentā€ type, with PKCE authentication (so that a user can retrieve an access token).
    With a client like Postman, I'm able to fetch a user access token via ā€œAuthentication Codeā€ grant type and the /oauth/v2/authorize and /oauth/v2/token endpoints. When calling a NestJS API endpoint protected by Zitadel authentication, the call to the introspection endpoint made in the strategy.js file of the passport-zitadel library receives a 400 Bad Request, indicating ā€œunauthorized_clientā€. Any ideas?
Was this page helpful?