• Resolved medyapin

    (@medyapin)


    Hi again, i have configured all details.

    Application
    DB connections etc.

    I used user migration tool. Auth0 script connects with db and return values as well.

    The issue is i have 2 problems.
    1- Users who try to login gets “There was a problem with your log in: Not Authorized [error code: 401]” (the user which i try also added to auth0 user list and changed his password by auth0 change password email”
    2- Cant create new users.

    In database settings Login User and Get User works well.

    Do you have any suggestion to solve theese issues? Kind Regards.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter medyapin

    (@medyapin)

    11 permisions are sellected in API which are listed in wordpress installation manual.

    Josh C

    (@auth0josh)

    I promise we’ll get you up and running @medyapin!

    > I used user migration tool.

    What is that exactly?

    > Users who try to login gets “There was a problem with your log in: Not Authorized [error code: 401]”

    Is this any user logging in?

    > the user which i try also added to auth0 user list and changed his password by auth0 change password email

    I’m not following this.

    > Cant create new users.

    In WordPress, Auth0, or both? Are you getting an error message? Users created in WordPress will not be sent to Auth0 but with the user migration setup, they should be migrated on their first login.

    > 11 permisions are sellected in API which are listed in wordpress installation manual.

    Never a bad thing to check but the login flow (before actual authentication) does not use the Management API.

    Thread Starter medyapin

    (@medyapin)

    Sorry for missunderstandings.

    Okay, There is no migration tool i was talking about i enabled user-migration and use existing database settings in auth0 dashboard and auth0 plugin and all works well.

    No users can login.

    Cant create new users In wordpress by auth0 login form. error is:

    WP_Auth0_LoginManager::redirect_login L:245 unknown_code An /oauth/token call triggered a 401 response from Auth0. Please check the Client Secret saved in the Auth0 plugin settings.

    Also i get exactly same error when existing users try to login.

    Thx

    Josh C

    (@auth0josh)

    Is there anything relevant in the Auth0 dashboard logs?

    Are you sure you have the correct Client Secret saved in the plugin settings? And that the secret is not marked as encoded?

    This means that authentication completed successfully but the code that the Auth0 server gave you cannot be exchanged for valid authentication information. That’s likely to be a configuration error.

    Thread Starter medyapin

    (@medyapin)

    By the way i checked the client secret but as you know its in not visble mod and not editable.

    I wanted to copy it from auth0 dashboard and paste it again to plugin settings for solving issue but couldnt becuase its not editable.

    Thx, i hope, we will make it work in the end.

    Thread Starter medyapin

    (@medyapin)

    Auth0 dashboard log also shows same log:

    Type Failed Exchange
    Description Unauthorized

    Client Secret automaticly set by plugin when its installed. or isnt it?

    Anyways i cant change it from plugin side.

    Josh C

    (@auth0josh)

    You’re correct, the Client Secret and encoding should be set properly by the setup wizard. You can paste in a new Client Secret into that field and it will be saved, just as an FYI. But if it wasn’t modified since you tried the wizard then there is no reason for it to be incorrect.

    This error should be happening at a URL like:

    `
    https://yoursite.com/index.php?auth0=1?code=LONG_STRING&state=EVEN_LONGER_STRING
    `

    Is that what you’re seeing? Is there a code and a state URL parameter with values? If you’re on a test/dev install, can you put this block of code at the top of wp-config.php and post the output here?

    https://gist.github.com/joshcanhelp/ba98f748747c7fd2ecdf54e73c6110f3

    Make sure to redact anything sensitive there (code param and anything else that comes through the cookies).

    Thread Starter medyapin

    (@medyapin)

    Thanks and i am sorry i made u spend time …

    Issue was after 30-40 installation tries ?? i saw that i forgat

    define( ‘AUTH0_ENV_CLIENT_SECRET’, ‘YOUR_CLIENT_SECRET_HERE’ );

    with wrong client secret in wp-config.

    This is why i always got 401 error.

    Now everything works perfect. Thx

    • This reply was modified 6 years ago by medyapin.
    • This reply was modified 6 years ago by medyapin.
    Josh C

    (@auth0josh)

    Great to hear! Thank you for digging and checking back in!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Not Authorized User 401 and Cant create new users.’ is closed to new replies.