Website getting issue on redirecting on Oauth callback.

Created on 22 August 2023, over 1 year ago
Updated 7 September 2023, about 1 year ago

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\docusign_signature\Controller\CallbackOAuth::page(): Return value must be of type Laminas\Diactoros\Response\RedirectResponse, Symfony\Component\HttpFoundation\RedirectResponse returned in Drupal\docusign_signature\Controller\CallbackOAuth->page() (line 58 of modules/contrib/docusign_signature/src/Controller/CallbackOAuth.php).

Can you please help with that?

๐Ÿ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia AnokR

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @AnokR
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia AnokR

    Also, getting this error after fixing the above error.

    The website encountered an unexpected error. Please try again later.

    OAuthException: Invalid OAuth state in Drupal\docusign_signature\DocuSignAuth\CodeGrant->authCallback() (line 46 of modules/contrib/docusign_signature/src/DocuSignAuth/CodeGrant.php).

  • Assigned to S3b0uN3t
  • Status changed to Fixed over 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance S3b0uN3t Nantes

    Hello,

    You are absolutely right. It's a misprint on my part.

    Thank you for your feedback and your attention! :)

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia AnokR

    Thank you for quick reply. Can you please check and fix issue in comment #2. for the second error?

  • Status changed to Postponed: needs info about 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance S3b0uN3t Nantes

    Sorry, I didn't see your comment yesterday.
    Our comments crossed.

    Can you tell me more about the situation in which you encounter this error?
    The GET parameter must correspond to what is normally declared in session.

    Can you check what this GET parameter is worth and what you have in session when it throws you the error?

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia AnokR

    http:://[Domain]/docusign/signature/callback/oauth?code=[CODE]

    Actually I have this request which is returning 400 (Bad request) and it will return the

    {
        "error": "invalid_grant"
    }
    

    As I debug it is throwing error at this file
    OAuthException: Invalid OAuth state in Drupal\docusign_signature\DocuSignAuth\CodeGrant->authCallback() (line 46 of modules/contrib/docusign_signature/src/DocuSignAuth/CodeGrant.php).

    But other requests are working before this request like
    Login, state etc.

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance S3b0uN3t Nantes

    I won't have time to test until next week.
    Feel free to provide a fix as a path or merge request.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia AnokR

    Sure, let me know. If you found something. It seems the api issue the token request is not working. It would be good if we can change the little bit to get it working.
    thanks!

  • Status changed to Fixed about 1 year ago
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance S3b0uN3t Nantes

    Hi,

    After several tests, it turns out that the OAuth callback is operational (both with Code Grant or JWT Grant).

    However, I noticed caching issues on the OAuth callback when page caching was enabled.
    I fixed this problem.
    In the context of normal use, we are now redirected to the initial page (and no longer to "/docusign/signature/callback/oauth" without a parameter in the URL).

    Good luck for the future and don't hesitate to make suggestions for developments (or submit them).

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia AnokR

    Thanks for your reply. can you push your latest updates so I can test at my end.
    However I will try to check with disabling the page cache.
    thanks

  • ๐Ÿ‡ซ๐Ÿ‡ทFrance S3b0uN3t Nantes

    Hello,

    Changes are already available in dev version.

    The ยซ invalid grant ยป error provides when you call Docusign OAuth callback url without query parameters or if you donโ€™t have a state define in temporary store (this state is defined on each Docusign OAuth request).

    By default, the callback is the current page (the page where you request Docusign). Donโ€™t hesitate to create a task and purpose a merge request to define a default callback path.

    Cheers

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024