Skip to content

invalid_grant when using IdentityServer4 #502

@reydevelop

Description

@reydevelop

First of all thank you for this awesome project! I've using months ago in my project with the previous version. It is great to have sql database option further than mongoDB.
I having trouble with this new version to get access_token, first part of the flow goes fine and can login but I'm getting
[next-auth][error][callback_oauth_error] { statusCode: 400, data: '{"error":"invalid_grant"}' } after redirect back.

I just cloned the example project and add an IdentityServer4 provider and connect to the same idsvr4 that is now working with previous version using a passport-oauth2 strategy.

Apparently code is lose at some point according to idsvr4
fail: IdentityServer4.Validation.TokenRequestValidator[0] Authorization code is missing, { "ClientId": "clientid", "ClientName": "clientname", "GrantType": "authorization_code", "Raw": { "grant_type": "authorization_code", "code": "", "client_id": "clientid", "client_secret": "***REDACTED***", "redirect_uri": "http://localhost:3000/api/auth/callback/identity-server4" } }

I tried using a custom OAuth provider but get same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsenhancementNew feature or requesthelp-neededThe maintainer needs help due to time constraint/missing knowledge

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions