Code Monkey home page Code Monkey logo

authmenace's Introduction

Authmenace

A very simple 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.

It is currently used by me on the wackomenace website to sign in to other services using GitHub as the authentication provider.

Quick start (local development)

Ensure Ruby 3.3.0 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

authmenace's People

Contributors

rubenarakelyan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.