Callback function issue with multiple redirect on same page.

Created on 7 December 2023, about 1 year ago
Updated 13 June 2024, 6 months ago

The callback seems to have an issue.
It redirects multiple times and troughs the error.
Even I have disabled the page cache module.
Location: https://domain/docusign/signature/callback/oauth
Error message: OAuthException: Invalid OAuth state in Drupal\docusign_signature\DocuSignAuth\CodeGrant->authCallback() (line 45 of /vhosts/privacypact.org/dev/privacypact/modules/docusign_signature/src/DocuSignAuth/CodeGrant.php).

I checked that the callback URL is the same in the DocuSign development account and that the integration and secret keys are also correct on both sides. All the DocuSign configuration is OK.

Please provide idea how we can get rid of the issue.

Thanks!

🐛 Bug report
Status

Closed: outdated

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
  • Status changed to Postponed: needs info about 1 year ago
  • 🇫🇷France S3b0uN3t Nantes

    Good morning,

    The status error is often linked to expired transaction issues.

    You reported a cache problem to me in issue 3382502 🐛 Website getting issue on redirecting on Oauth callback. Fixed which has since been corrected.

    It is impossible for me to debug your query with this error without context. I updated the exception so that it returns the current state and the expected state to help you to investigate.

  • 🇮🇳India AnokR

    Thanks for the quick reply

    Yes, I as for as I found it is related to cache. Because when I open form at this location : "/docusign-signature/examples/embedded-signature" and sign in to DocuSign it will send correct query parameters and connect to docuSign account and send back to that form url "/docusign-signature/examples/embedded-signature". But due to cache it was unable to check the checkToken due to this line

        if (!$this->authService->checkToken()) {
          return $this->client->needToReAuth();
        }

    it redirects to Auth login again and this process get continue and return the error.

    Temp fix:- When we clear cache manually and then again go to same form for Auth login it works correctly.
    I have disable the Internal page cache module but the problem is not resolved!.

    If you are not getting this error at your end so might be some other issue.
    Thanks

  • Assigned to S3b0uN3t
  • Status changed to Needs work about 1 year ago
  • 🇫🇷France S3b0uN3t Nantes

    Hello,

    Thank you for the clarification.
    I now understand the origin of the problem and will come back to you in the next few days with a fix.

  • Issue was unassigned.
  • Status changed to Needs review about 1 year ago
  • 🇫🇷France S3b0uN3t Nantes

    Hello,

    I moved the access token check to the route rather than the form. This no longer seems to produce redirection problems when caches are activated (anonymous as well as connected).

  • Status changed to Closed: outdated 6 months ago
Production build 0.71.5 2024