• Good Afternoon,

    I’m having several errors with the plugin since I did an update on it. I’m able to get a JSON Web Token from the auth endpoint; however, when I attempt to use this for autologin, it’s giving me error 23. When I attempted to test this in PostMan, it’s giving me error 11.

    WordPress Version: 5.8.1
    Plugin Version: 3.3.1

    Example URL Call for AutoLogin (please note that my website URL and JWT have been redacted by me due to this forum being public):
    https://{{MYWEBSITEURL}}/?rest_route=/simple-jwt-login/v1/autologin&JWT={{JWT RECEIVED FROM AUTH CALL}}&redirectUrl=https%3A%2F%2F{{MYWEBSITEURL}}%2Fcourses%2Fannual-hipaa-training%2F

    Here are the settings that are currently configured:

    General
    Decryption key source: Plugin Settings
    JWT Decrypt Algorithm: HS256
    Decryption Key: set with a 32 character string
    JWT Decryption Key is base64 encoded: No (Unchecked)
    Get JWT Token from:
    – REQUEST: JWT (ON)
    – SESSION: Off
    – COOKIE: Off
    – Header: Authorization (ON)
    All WordPress endpoints checks for JWT Authentication: On (checked)

    Login
    Allow Auto-Login: Yes
    Auto-Login Requires Auth Code: No
    JWT Login Settings: Log in by WordPress Username (JWT Parameter Key: username)
    Redirect after Auto-Login: Dashboard
    Include request parameters used for login link in the REDIRECT URL: Yes
    Allow redirect to a specific URL if redirectUrl is present in the request: Yes

    Authentication
    Allow Authentication: Yes
    Authentication Requires Auth Code: No

    CORS
    Allow CORS: Yes
    CORS Headers: All enabled and default values

    I have uninstalled and reinstalled the plugin and reconfigured it, but it gave the same results.

    Any assistance would be greatly appreciated.

    Thanks,
    Kris

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter krisosterhout

    (@krisosterhout)

    Hello,

    I’m still having the same issue and I can’t find a resolution. Do you have any suggestions? Any help would be greatly appreciated.

    Thanks,
    Kris

    Plugin Author nicu_m

    (@nicu_m)

    Hello @krisosterhout,

    Sorry for my late response.

    Here you can check the error codes: https://docs.simplejwtlogin.com/#/?id=error-codes

    Meanwhile, you can encode your encryption key to base64 (https://www.base64decode.org/), and use the checkbox “JWT Decryption Key is base64 encoded”.

    I will investigate this issue, and come back with updates.

    Best regards,
    Nicu.

    Thread Starter krisosterhout

    (@krisosterhout)

    Hi Nico,

    I have an update for you. If I turn off the Header authentication option, then the REQUEST option works. So, for more info:

    General Settings
    Get JWT token from
    1. Request — ON
    2. Session — OFF
    3. Cookie — OFF
    4. Header — OFF

    However, I need both the Request and the Header options available as I use the header for the REST API and the Request option for autologin. Any ideas?

    Thanks,
    Kris

    Thread Starter krisosterhout

    (@krisosterhout)

    Hi Again Nico,

    I remembered that this was an issue in the past that I had fixed via changing the preg_match regex.

    I’ve fixed it again with the following change:

    src/Services/BaseService.php

    Line 167 – Original Code
    '/^(?:Bearer)?[\s]*(.*)$/mi'

    Line 167 – Changed Code
    '/(?:Bearer ?)?(.+)/m'

    I am not strong with regex, so it’s difficult for me to analyze what the issue is. I’m also not sure why other people aren’t reporting issues with this. I just wanted to let you know that this corrected our issue.

    Thanks,
    Kris

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Multiple errors with no real reason’ is closed to new replies.