Support » Plugin: WP OAuth Server (OAuth Authentication) » Bad Redirect After Login

  • Hi. First, thanks for a great plugin! Second, I’ve been running into an issue with the redirect after the user logs into WordPress. WordPress lives at https://somedomain.org/blog, so I’ve configured my OAuth2 client (the oauth2 Ruby gem) in the following way:

    site: https://somedomain.org
    authorize_url: /blog/oauth/authorize

    When I access the generated authorization url, it reaches the plugin, which redirects to the WordPress login form just fine. However, the path of the URL that is given to the form by your plugin is https://somedomain.org/blog/blog/oauth/authorize. The doubled up “blog” causes a 404 when I submit the form.

    The line that seems to be the source of the trouble is this one from class-wo-api.php:

    wp_redirect( wp_login_url( site_url( $_SERVER[‘REQUEST_URI’] ) ) );

    The site URL configured by WordPress is https://somedomain.org/blog. The authorize URL is /blog/oauth/authorize. These get concatenated together by site_url. I’ve worked around the issue by just removing the site_url call.

    Do the developers have any better suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Justin Greer

    (@justingreerbbi)

    Forum Moderator

    Thank you for pointing this out. I will be sure to send this to the project manager to put on the list to discuss in our next meeting.

    The issue seems to be what you suggested but this is only happening for your type of setup. We may be able to use home_url() instead. We will run tests and update as needed.

    Thanks,
    Justin Greer

    manchaary

    (@manchaary)

    Hello,
    This issue still persist, changing plugins core files is not a way to solve this.
    How do i resolve this issue?

    WP OAuth Server Build 3.6.0
    Wordpress version 4.9.8

    Hi Team,

    We have the same problem.

    We are working with the WordPress core in a separated folder /wp.

    So everything works but it redirect us to domain.com/wp and not to domain.com.

    Main site =>
    WP OAuth Server Build 3.7.0
    Wordpress version 4.9.9

    Sub site =>
    OAuth 2.0 Single Sign On 1.3.2
    Wordpress version 4.9.9

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Bad Redirect After Login’ is closed to new replies.