Rootzilla 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.
gus 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...
maicol07 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)
gus maicol07 Here is the response: { "errors": [ { "status": "405", "code": "method_not_allowed" } ] }
maicol07 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?
maicol07 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
gus 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 maicol07 Yes, but it's the same, thank you. I'll try to find another way to link flarum to my website.
maicol07 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 I have 2 simple questions: Should I add something to allowed_ips in the api_table ? What does mean the field scopes ?
maicol07 gus 1. No, that shouldn't affect an API call I think scopes means the purposes of the API token. @luceos maybe knows more of this
maicol07 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
Droplet 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.
maicol07 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!