010101
I have that same problem. When I click the login button, it redirects to Wordpress and login but it seems that I have not logged in to Flarum.
Rootzilla try the solution in the post above yours
maicol07 There is no XHR request, I'm still trying to fix the issue, but I don't have any idea.
Here is the error : Warning: file_get_contents(https://forum.myWebsite.fr/api/token): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in...
Warning: file_get_contents(https://forum.myWebsite.fr/api/token): failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in...
gus Your problem is very strange. Request returns a 403 forbidden error. Try going to {your forum}/api/token using your browser and paste the screenshot here (obviously changing {your forum} with your Flarum URL)
{your forum}/api/token
{your forum}
maicol07 Here is the response: {
"errors": [ { "status": "405", "code": "method_not_allowed" } ]
}
gus ok, that's fine. What PHP version do you have on your SSO system and does your Flarum URL contains any special characters like spaces?
I'm using PHP 7.3.6, and the flarum url do not contains any special character
gus As described here it might be an error of your server. Try again checking your API token (403 means that you don't have the right permissions to show that content): it must be 40 characters long and assigned to admin ID. Also tell me if your admin user ID is different from 1
maicol07 Thanks for your answer, the admin id is 1 (default). I'm trying to find a solution with the server but I don't know where comes from the problem.
gus Try maybe to change the API token using the website provided in the configuration guide
maicol07 Yes, but it's the same, thank you. I'll try to find another way to link flarum to my website.
maicol07 I tried with Curl but permissions are denied too. (The forum is hosted at OVH)
gus Do you have experience with curl? You can try doing a request with it and, if that works for you, I'll include this in a new release
gus Well, that's very strange...
I have 2 simple questions:
allowed_ips
api_table
scopes
gus 1. No, that shouldn't affect an API call
maicol07 Thank you, (I'm still trying to make it working 😫)
gus Try making a request with this tool: https://reqbin.com/ I've used it to debug requests for my Flarum Try adding headers, edit contents... Make sure it's a POST request. You can get default parameters from the Flarum class
Would https://mc-oauth.net work with your extension, @cmcjacob was wondering if it might work with an existing extension.
I need something like this for a Minecraft forum.
Droplet you'll need to build a SSO system that acts like an intermediary between Flarum and MC Auth. The workflow basically is this: LOGIN (MC Auth) --> PHP SSO system (Logs the user into Flarum) --> Flarum (Logged in) If you have any questions, feel free to ask!
LOGIN (MC Auth) --> PHP SSO system (Logs the user into Flarum) --> Flarum (Logged in)