Generate an access token for Mastodon
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
env.json.sample
mastodon.sh

README.md

Mastodon Access Token Generator

Generate an access token for Mastodon.

Requirement

  • jq

Usage

For details on the Mastodon API, see API overview.

Interactive mode

$ sh mastodon.sh
Enter your host: https://mastodon.social
Enter client name: My Mastodon App
Enter scope: read write follow
Enter website: (optional) http://myappwebsite.com

Access https://mastodon.social/oauth/authorize?client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&response_type=code&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=read%20write%20follow and click "AUTHORIZE" button. Then copy the code and paste it here after the message "Enter authorization code".

Enter authorization code: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

Your access token is zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.

Now you can use zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz as an access token to your Mastodon application.

Recyclable mode

Copy env.json.sample to env.json and edit env.json.

$ cp env.json.sample env.json
# Edit env.json

The generator reads env.json automatically if it exists.

$ sh mastodon.sh
Access https://mastodon.social/oauth/authorize?client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&response_type=code&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=read%20write%20follow and click "AUTHORIZE" button. Then copy the code and paste it here after the message "Enter authorization code".

Enter authorization code: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

Your access token is zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz.

Now you can use zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz as an access token to your Mastodon application.

License

Copyright (c) 2017 noraworld - MIT License