dhallman
dhallman

Reputation: 1

Getting missing parameter "accessToken" exception using fastify-oauth-server (npmjs)

I set up a fastify server that uses fastify-outh-server with the in-memory-model. I'm trying to connect from postman using a "client_credentials" flow. The server throws an exception "missing parameter: accessToken" when I try to retrieve a token. The in-memory-model looks to be getting the right client and saving the token. The exception occurs after that in the oauth2-server code which I don't believe I should have to touch. I see that the code creating a new TokenModel is getting null data.

enter image description here

Any thoughts on what I'm doing wrong?

Upvotes: 0

Views: 312

Answers (1)

dhallman
dhallman

Reputation: 1

I enlarged my search and eventually ended up at the oauth2-server module. This is the module that the fastify-oauth-server is wrapping. After some reading I found that others had had problems with the inMemoryModel.js (example). That is what I had been using for testing. I found a git repo where this had been corrected (Code to fix the problem) The example saveToken method was not returning the token. That solved my problem.

Upvotes: 0

Related Questions