Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing parameter 'accessToken' when invoking token() #96

Open
kenanEkici opened this issue Jul 6, 2020 · 2 comments
Open

Missing parameter 'accessToken' when invoking token() #96

kenanEkici opened this issue Jul 6, 2020 · 2 comments

Comments

@kenanEkici
Copy link

I'm using token() with "password" as grant_type and am providing client, secret, username and password. The GetUser() of my model is able to retrieve and return the user. However, as a response I get "missing parameter 'accessToken'. It doesn't make sense to my why I should be providing accessToken when I'm clearly requesting for one?

@eternal-scholar
Copy link

eternal-scholar commented Jun 30, 2022

I had the same issue.
In my case the real error was printed in the terminal where the api was running and not in the output error in postman.
"SequelizeValidationError: string violation: accessTokenExpiresAt cannot be an array or an object"
it was caused by the fact that I had set accessTokenExpiresAt to string instead of date

@jhunexjun
Copy link

Is this fixed already? We have the same issues and actually encountered different issues but this is just one.
To all the issues I encountered, I dealt it by making sure that all methods return should match the object structure the OAuth2.0 server is expecting in the model. Like:

function getRefreshToken(bearerToken) {
// more codes here
   return {
           refreshToken: result[0].refresh_token,
           refreshTokenExpiresAt: result[0].expires_at,
           // scope: result[0].scope,  // optional.
           client: { id: result[0].client_id }, // with 'id' property
           user: { id: result[0].user_id },
         };

You can add more as the docs says but the minimum should be met.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants