• Resolved cgoro

    (@cgoro)


    Am currently running Version 1.8.5 of the mail integration plugin on our site.
    After the update, the plugin stopped working and prompted for reauthorization.
    When attempting the reauthorization the below error keeps occurring:
    Fatal error: Uncaught _PhpScoper99e9e79e8301\Firebase\JWT\ExpiredException: Expired token in /home/gertiesweb/public_html/wp-content/plugins/mail-integration-365/libs/vendor/firebase/php-jwt/src/JWT.php:124 Stack trace: #0 /home/gertiesweb/public_html/wp-content/plugins/mail-integration-365/libs/vendor/thenetworg/oauth2-azure/src/Token/AccessToken.php(24): _PhpScoper99e9e79e8301\Firebase\JWT\JWT::decode('eyJ0eXAiOiJKV1Q...', '-----BEGIN PUBL...', Array) #1 /home/gertiesweb/public_html/wp-content/plugins/mail-integration-365/libs/vendor/thenetworg/oauth2-azure/src/Provider/Azure.php(334): _PhpScoper99e9e79e8301\TheNetworg\OAuth2\Client\Token\AccessToken->__construct(Array, Object(_PhpScoper99e9e79e8301\TheNetworg\OAuth2\Client\Provider\Azure)) #2 /home/gertiesweb/public_html/wp-content/plugins/mail-integration-365/libs/vendor/league/oauth2-client/src/Provider/AbstractProvider.php(462): _PhpScoper99e9e79e8301\TheNetworg\OAuth2\Client\Provider\Azure->createAccessToken(Array, Object(_PhpScoper99e9e79e8301\League\OAuth2\Client in /home/gertiesweb/public_html/wp-content/plugins/mail-integration-365/libs/vendor/firebase/php-jwt/src/JWT.php on line 124
    The last time this error occurred @edwardcross, recommended reauthorization which worked then but is not working today.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter cgoro

    (@cgoro)

    The error displayed on the plugin page:
    invalid_grant AADSTS54005: OAuth2 Authorization code was already redeemed, please retry with a new valid code or use an existing refresh token. Trace ID: 1bbf59c6-5e03-4829-8575-5fb577997700 Correlation ID: a8f59c80-054d-4bc9-ac40-9bb5e670cbf7 Timestamp: 2022-01-19 13:38:10Z

    @cgoro so you are loading the settings page with the old authorisation code still within the URL. Clear the settings page URL of any URL parameters (that’s everything after the ?) and reload the page. Once it’s loaded, try the authorise button again.

    @cgoro the other thing you could check (having read this guide: https://docs.microsoft.com/en-us/answers/questions/311300/oauth2-authorization-code-was-already-redeemed.html) is that your client secret hasn’t expired.

    The expiry time is set when you create the secret. If you chose just a few months this might explain the error. If it’s expired, you will need to create a new secret and copy this into the plugins settings area.

    Thread Starter cgoro

    (@cgoro)

    The secret value has not expired.
    I have cleared the settings URL of any parameters but the Fatal Error is still recurring when I attempt authorization.
    The second error about the invalid grant is no more.

    @cgoro so I would make a note of the Client and Tenant ID’s then untick the option “Keep OAuth Credentials” in the plugin settings page (if it isn’t already unticked). I’d then deactivate and reactivate the plugin.

    Re-enter the client and tenant ID’s and regenerate a client secret from within the Azure App settings on the Azure AD Portal (id delete the old secret as well).

    Save the settings and then reauthorize. This process should clear all the old values from the database.

    @cgoro I assume, as it’s been over two months that this was fixed so I’m closing.

    Thread Starter cgoro

    (@cgoro)

    The issue was resolved

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Authorization Issue’ is closed to new replies.