Thanks that worked! Getting very close now, I think I am on the home stretch 🙂 I've created a api token in the database manually and linked it to the admin account, however the token returns a 401 in the logs when performing sign on. The api_keys
table entry consists of the key
(40 char alpha numeric string generated from the tool in your docs), the id
(1), and the user_id
(also 1), and nothing more. In the instantiation of the object the password is set as a random string, nothing specific.
I am not sure if it was expected behaviour, but the login using the local admin no longer works, there are some login modal errors. That was when I did not have the login url set in the extension settings, I added that so it goes directly to my sites login page now. But I wasn't sure if that was indicative of another issue or expected.
"POST /api/token HTTP/1.1" 401 67 "-" "Flagrow Api Client"
* @param string $url Flarum URL <- community.domain.com
* @param string $root_domain Main site or SSO system domain <- domain.com
* @param string $api_key Random key from the api_keys table of your Flarum forum <- generated api key as described above
* @param string $password_token Random token to create passwords -> randomly entered string
* @param int $lifetime How many days should the login be valid -> 30 days
* @param bool $insecure Insecure mode (use only if you don't have an SSL certificate) -> true as I am testing locally
* @param bool $set_groups_admins Set groups for admins. Set to false if you don't want to set groups to admins -> true, although I am not sure what this does yet