Post 9pGU8IbE3JZFc2UIOu by hugot@mastodon.nl
(DIR) More posts by hugot@mastodon.nl
(DIR) Post #9pGU8IbE3JZFc2UIOu by hugot@mastodon.nl
2019-11-23T20:40:13Z
0 likes, 0 repeats
@fedilab what does #Fedilab use for oauth authentication? Do you have some sort of webserver setup to handle that?
(DIR) Post #9pGU8N0tdoTjIoWqy8 by fedilab@toot.fedilab.app
2019-11-23T20:42:17Z
0 likes, 0 repeats
@hugotIt's directly done with APIs. I might not clearly understood your question though?
(DIR) Post #9pGUqS3uERmphZxLay by hugot@mastodon.nl
2019-11-23T20:50:17Z
0 likes, 0 repeats
@fedilab Well I mean, in order to do oauth, you need to have a server to redirect to right? The typical flow would be to have your server request client secrets and ID's for each instance and provide your users with tokens like in the example here: https://docs.joinmastodon.org/api/authentication/Your server would have to provide a redirect_uri so that the mastodon instance can redirect to that to provide an authorization code, which you can use to retrieve an acces token, etc.How is this implemented for fedilab?
(DIR) Post #9pGbBAlMLPhVr7Xqfw by fedilab@toot.fedilab.app
2019-11-23T22:01:17Z
0 likes, 0 repeats
@hugotYou don't need a server for getting the redirect. Just put a call back that only your app can handle. That's how it works. I stopped to use password grant flow with Mastodon for improving UX. The app simply works with an authorization code for generating the token.Also, you can check the source code of fediplan (php) with a similar approach.
(DIR) Post #9pGbn8QrSS0fdE3iXg by fedilab@toot.fedilab.app
2019-11-23T22:08:12Z
0 likes, 0 repeats
@hugotAlso, client id and secret are dynamically created whereas other centralized social networks. Don't forget this step before the oauth flow.
(DIR) Post #9pGcb5Tmi7X0x8FHZQ by hugot@mastodon.nl
2019-11-23T22:17:08Z
0 likes, 0 repeats
@fedilab Ah, right! Should have thought of that. Too bad custom url schemes and the like are not an option for my platform :(Oh well, I've hacked together a little server and all is good now, was just curious how you had solved the same problem :)
(DIR) Post #9pGdDdsvExjefCO6ZE by hugot@mastodon.nl
2019-11-23T22:24:09Z
0 likes, 0 repeats
@fedilab I have thought of that, I am dynamically requesting credentials (creating apps) for instances I haven't authenticated against before.Here is my code: https://github.com/hugot/generic-mastodon-authenticator . It's not much and I'm relatively new to #golang, but it works! 🐵