phil on Nostr: Nate Hi! Afaik first you need to register an app, then you can authorize this app for ...
Nate (npub1vfy…rte7) Hi!
Afaik first you need to register an app, then you can authorize this app for your account and then you can get the access token. This can be done with the Mastodon API which is supported by Friendica: wiki.friendi.ca/docs/api-masto…
You should be able to register an "app" with this command:
$ curl -s -X POST -d '{"client_name":"your_python_script","redirect_uris":"urn:ietf:wg:oauth:2.0:oob","scopes":"read,write"}' -H 'Content-Type: application/json' "https://nerdica.net/api/v1/apps";
-> docs.joinmastodon.org/methods/…
This command should return a client_id and client_secret.
With these, you can then request an authorization code from the OAuth end point:
-> docs.joinmastodon.org/methods/…
Open https://nerdica.net/oauth/authorize?client_id=client_id_from_previous_response&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=read+write in the browser and it should display the authorization code after you granted access.
This authorization code can then be sent to the /oauth/token end point to get the access token which you can use in your script.
I did not test it, but hope it works 😀
Afaik first you need to register an app, then you can authorize this app for your account and then you can get the access token. This can be done with the Mastodon API which is supported by Friendica: wiki.friendi.ca/docs/api-masto…
You should be able to register an "app" with this command:
$ curl -s -X POST -d '{"client_name":"your_python_script","redirect_uris":"urn:ietf:wg:oauth:2.0:oob","scopes":"read,write"}' -H 'Content-Type: application/json' "https://nerdica.net/api/v1/apps";
-> docs.joinmastodon.org/methods/…
This command should return a client_id and client_secret.
With these, you can then request an authorization code from the OAuth end point:
-> docs.joinmastodon.org/methods/…
Open https://nerdica.net/oauth/authorize?client_id=client_id_from_previous_response&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=read+write in the browser and it should display the authorization code after you granted access.
This authorization code can then be sent to the /oauth/token end point to get the access token which you can use in your script.
I did not test it, but hope it works 😀