Access token for API service
Hello everyone :)
I've just setup Loomio docker on a personal server and now I am trying to integrate some of the functions into my custom portal in PHP (functions such as listing latest non-public discussions in widgets etc).
In a Loomio API manual (https://help.loomio.org/en/dev_manual/using_the_api/) that I've been following I've noticed that we can use the access token to authenticate API requests to Loomio, but I couldn't find a way to create any keys for oauth2.
I was planning on using https://github.com/thephpleague/oauth2-client for this, but I am willing to use any other php solution if this one doesn't fit.
I've read somewhere that we can create the access keys using URL https://<your_loomio_hostname>/apps/registered but I get "We were unable to find that. It may have been deleted or moved."). Do I need to setup something else for this link to work?
I would really appreciate some help on this matter.
I thank you in advance.
Robert Guthrie Wed 8 Apr 2020 8:37PM
There is example code around where someone is doing this, I'm trying to find out where it was now.
Robert Guthrie Wed 8 Apr 2020 8:51PM
Arr, found it @Obi . Hope this is helpful: https://github.com/Edgeryders-Participio/dreams/blob/master/lib/loomio/loomio_handler.rb
Obi Wed 8 Apr 2020 8:53PM
This is probably going to help. I'll report back once I test it out. Thank you :)
Robert Guthrie · Wed 8 Apr 2020 8:37PM
Hi @Obi , the access_token stuff has been removed, as nobody was using it and I was getting security warnings about it.
The best way to use the api is to login and get a session cookie, then pass that cookie along with your api requests.
Does that make sense?