Skip to content

Instantly share code, notes, and snippets.

@samuelgoto
Last active August 28, 2018 00:44
Show Gist options
  • Save samuelgoto/0114e5eef7b8cb2956b28a919139c596 to your computer and use it in GitHub Desktop.
Save samuelgoto/0114e5eef7b8cb2956b28a919139c596 to your computer and use it in GitHub Desktop.

Auth

Signing-in and authenticating

https://indieauth.com/auth?me=http%3A%2F%2Fcode.sgo.to&client_id=http%3A%2F%2Fcode.sgo.to&state=456&scope=read%20follow%20mute%20block%20create&redirect_uri=http%3A%2F%2Fcode.sgo.to

Redirected to

http://code.sgo.to/?code=${code}&me=http%3A%2F%2Fcode.sgo.to%2F&state=456

Trading for an access token

curl -d "grant_type=authorization_code&client_id=http%3A%2F%2Fcode.sgo.to&redirect_urittp%3A%2F%2Fcode.sgo.to&me=http%3A%2F%2Fcode.sgo.to%2F&code=${code}" -X POST -H "Content-Type: application/x-www-form-urlencoded" https://tokens.indieauth.com/token

Response

me=http%3A%2F%2Fcode.sgo.to%2F&scope=read&access_token=${token}&token_type=Bear

Searching for feeds:

curl https://aperture.p3k.io/microsub/109 -H "Authorization: Bearer {access}" -X POST -d "action=search&query=aaronparecki.com"

Querying channels

curl https://aperture.p3k.io/microsub/109?action=channels -H "Authorization: Bearer {access}" -X GET

Subscribing to feeds:

curl https://aperture.p3k.io/microsub/109 -H "Authorization: Bearer ${token}" -X POST -d "action=follow&channel=xvpsnHFwbD0NnIR7rhJbBwwk&url=http%3A%2F%2Fcode.sgo.to"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment