Skip to content

A super-simple Ruby IndieAuth authorization and token endpoint with no database

License

Notifications You must be signed in to change notification settings

rubenarakelyan/authmenace

Repository files navigation

Authmenace

A very simple Ruby IndieAuth authorization and token endpoint heavily inspired by Acquiescence.

Description

Authmenace uses JSON Web Tokens to grant access to third-party websites that implement the IndieAuth standard. It therefore does not need any database.

Quick start (local development)

Ensure Ruby 3.3.4 is installed. Then run:

cp .env.example .env
bundle install
bundle exec puma

Remember to edit your new .env file to set the GitHub details and private key for JWTs.

Authentication providers

Since I originally built Authmenace for myself, I have only implemented GitHub as an authentication provider. However, I am more than happy for others to contribute extra providers that have corresponding Omniauth strategies.

GitHub

To use the GitHub provider, you need to create a new OAuth app to receive a client ID and secret using the following steps:

  1. Go to https://github.com/settings/developers
  2. Click the "New OAuth App" button
  3. Give your application a name and homepage (you should set these to the name and homepage of your website)
  4. Set the authorization callback URL to https://your.domain/auth/github/callback, where your.domain is the domain you're using to host Authmenace
  5. Click the "Register application" button
  6. You will see a client ID - make a note of this
  7. Click the "Generate a new client secret" button
  8. Make a note of the client secret (it will not be shown again)
  9. Use these details to set the environment variables for the app

Environment variables

  • GITHUB_CLIENT_ID: the client ID of the GitHub OAuth app
  • GITHUB_CLIENT_SECRET: the client secret of the GitHub OAuth app
  • GITHUB_USERNAME: your GitHub username (only this username will be allowed to authenticate)
  • JWT_PRIVATE_KEY: an ECDSA private key to use for signing generated JWTs

Testing

bundle exec rspec

Bug reports

Please open an issue on the GitHub repository for any bugs.

Contributing

All contributions are welcome. Feel free to fork the original GitHub repository, make your changes and then open a Pull Request against the original GitHub repository. Alternatively, if you're not comfortable writing code, please open an issue.

Licence

MIT licence

About

A super-simple Ruby IndieAuth authorization and token endpoint with no database

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages