This flow works well with default wordpress login but when I’m trying to login using the miniOrange Social Login or miniOrange OAuth Client it logs in the user but doesn’t really takes back the user to the Website B. Rather it takes the user to the home page of Website A where the social logins have been setup.
I have used the redirect methods also. But it says using the wordpress default login screen it won’t redirect back the user to where it came from rather it’ll redirect user back to the home page.
Please let me know if you have any alternate solution to it. It would really help a lot to me.
]]>Thank you.
]]>TLDR:
I’m evaluating using WP Auth from NET Core. However, I’m getting a Bad Request when accessing the /oauth/me endpoint.
Details:
My client sends the authorize request like this:
https://backupshop.wpengine.com/oauth/authorize/?client_id=<redacted>&scope=basic&response_type=code&redirect_uri=https%3A%2F%2Flocalhost%3A5000%2Fcallback&state=CfDJ8NYqZtYibXVAl-HRi6IpPiSHYvUtcqUKR6HGaRybtfiuaXucDIskzWvRvgfxDoeKT9nDoDTmEU1dGT8WYJJzEqQ0wlRs6J0TmsrQiLbVZ_QiD_oxUXVTIRrgPR1F1Y_yKYlwZHeG3B-SEGMmCOL8oAHLeZ-nnMXJ-c3I2idXL4J4d0UJvM2tg3lXOrE7o11_OGlRhOQ3H2bdnqZh594-ROUsRUR3gbGczW_c-KhUBlIV-PhEvn4L1GZDNWDku3VNqliTwlBa4_VDNP6xeGxxWIYL_EOdsLkKKVBPapKtfUmO_EgVUc43gVAndmfsIrIA_A
Then gets a code at the callback URL and uses it successfully to get an access token:
https://backupshop.wpengine.com/oauth/token
with
client_id=<redacted>&redirect_uri=https%3A%2F%2Flocalhost%3A5000%2Fcallback&client_secret=<redacted>&code=sm3lyidi1iipwx6af96xfiwhdz8i3y0zxvhx439m&grant_type=authorization_code
The response contains the access token:
access_token=udgbhlgft7celbtvmulr718ewwpf3qeey3wtkczxnqayzixuyk0vd4ldfjv8
Then, as is usual for libraries wrapping external OAuth2 providers for ASP NET Core, it tries to get the profile info:
https://backupshop.wpengine.com/oauth/me
with
Authorization: Bearer udgbhlgft7celbtvmulr718ewwpf3qeey3wtkczxnqayzixuyk0vd4ldfjv8
However, the response is
Bad Request
with
{“error”:”invalid_request”,”error_description”:”Invalid token”,”error_uri”:”https:\/\/tools.ietf.org\/html\/draft-ietf-oauth-v2-31#section-7.2″}
However, the token sent was the right one. So I am somewhat at a loss here.
Any ideas?
Thanks,
Mark
Please guide me.
]]>Is this the expected behaviour or am I doing something wrong?
If this is the expected behaviour what do I have to do to access the WP API without manually intervening to login into the target site?
FYI once logged in my implementation works fine.
]]>https://www.ads-software.com/plugins/oauth2-provider/
]]>