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.
![RG](/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBK0xZRVE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--7a581de88c41bcec9b40d2bb53a4dc7ab8efdb69/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDRG9MWm05eWJXRjBTU0lJYW5CbkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFHQWFRR0FPZ3B6WVhabGNuc0hPZ3h4ZFdGc2FYUjVhVlU2Q25OMGNtbHdWQT09IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--bee53b50eefebbfaf3427852775dd64daaceca76/IMG_4141.CR2.jpg)
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.
![RG](/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBK0xZRVE9PSIsImV4cCI6bnVsbCwicHVyIjoiYmxvYl9pZCJ9fQ==--7a581de88c41bcec9b40d2bb53a4dc7ab8efdb69/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDRG9MWm05eWJXRjBTU0lJYW5CbkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVFHQWFRR0FPZ3B6WVhabGNuc0hPZ3h4ZFdGc2FYUjVhVlU2Q25OMGNtbHdWQT09IiwiZXhwIjpudWxsLCJwdXIiOiJ2YXJpYXRpb24ifX0=--bee53b50eefebbfaf3427852775dd64daaceca76/IMG_4141.CR2.jpg)
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
Hey Rob,
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?