• Hi, I am trying to link an ASP Net client to a WP server using this oauth plugin.
    It is on a test site so far to establish the principle.
    I realise that the redirect_uri is optional and if I don’t use it, it (appears to) works fine..

    Go to client, go somewhere that needs authorization, it goes to the WP server for login. Token etc comes back.

    (more detailed testing required, but I do get a token, expiry, refresh etc. back to the client).

    However, the default behaviour of asp oauth, and best practice really needs the redirect_uri and backchannel stuff working.

    I am getting this error:

    {“error”:”redirect_uri_mismatch”,”error_description”:”The redirect URI provided is missing or does not match”,”error_uri”:”http:\/\/tools.ietf.org\/html\/rfc6749#section-3.1.2″}

    I am running WP version 5.4.1 hosted on one.com.
    I have checked with them and they are not doing anything ‘odd’ at their end, they claim. I do believe that since the token is coming back, and some earlier thesting with a Jwt plugin worked fine before I decided to try this oauth route.

    The client is running on my home office machine without a DNS resolvable name so the callback IP address is:

    https://xx.yyy.zz.nnn/oauth/callback

    This url is deinitely there and I get an asp error message back from that if I try it from outside my home.
    I have used ‘fiddler’ to check and it is not getting through

    my .htaccess file is as follows:

    #This is from Oauth Server web page at
    #
    #https://wp-oauth.com/docs/common-issues/header-authorization-may-not-work-as-expected/
    #
    RewriteEngine On
    SetEnvIf Authorization “(.*)” HTTP_AUTHORIZATION=$1
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    The ‘Status’>General Information does say ‘Notice – Header ‘Authorization Basic’ may not work as expected.

    To summarize:
    All looks ok and it appears to work without the redirect_uri.
    As soon as I add my redirect_uri it fails with error message above.
    my redirect_uri does exist and gives an expected error if I just address the url.

    • This topic was modified 4 years, 6 months ago by brettbutcher.
Viewing 1 replies (of 1 total)
  • Thread Starter brettbutcher

    (@brettbutcher)

    So, I solved this myself in the end. Partly by finding bits of this forum dealing with similar issues that pointed to web pages sadly no longer there…
    I get that this is free and all, but I would have acutally bought it had I been able to get help with the evaluation process.
    Now I need to figure out how to log out, so I’ll have just one more go.
    If anyone else is struggling getting going with this and using it with asp net core, this is a link to a new question I have on StackOverflow, but also shows how I got to a nearly working solution.
    Link to question.

Viewing 1 replies (of 1 total)
  • The topic ‘redirect_uri always errors’ is closed to new replies.