{"id":13776480,"url":"https://github.com/hypebeast/micro-auth","last_synced_at":"2026-01-25T09:19:44.017Z","repository":{"id":139656707,"uuid":"82488727","full_name":"hypebeast/micro-auth","owner":"hypebeast","description":"A microservice that makes adding authentication with Google and Github to your application easy.","archived":false,"fork":false,"pushed_at":"2017-03-23T20:47:47.000Z","size":11,"stargazers_count":469,"open_issues_count":0,"forks_count":23,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-04-14T14:16:13.631Z","etag":null,"topics":["authentication","docker","docker-compose","github","google","lapis","nginx","openresty"],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hypebeast.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-02-19T20:51:55.000Z","updated_at":"2024-01-13T23:56:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"de49a29f-f9ea-44f2-99b8-9bbeae667548","html_url":"https://github.com/hypebeast/micro-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypebeast%2Fmicro-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypebeast%2Fmicro-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypebeast%2Fmicro-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hypebeast%2Fmicro-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hypebeast","download_url":"https://codeload.github.com/hypebeast/micro-auth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253551572,"owners_count":21926317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","docker","docker-compose","github","google","lapis","nginx","openresty"],"created_at":"2024-08-03T18:00:27.135Z","updated_at":"2026-01-25T09:19:44.003Z","avatar_url":"https://github.com/hypebeast.png","language":"Lua","readme":"# micro-auth\n\nA microservice that makes adding authentication with Google or GitHub to your application easy.\n\nThis service allows you to use Google and GitHub OAuth2 service to add authentication to your applications in a very straightforward way.\n\nIt's build with [Nginx/OpenResty](https://openresty.org/en/), [Lapis](http://leafo.net/lapis/) and [Docker](https://www.docker.com/). This enables the service to be very performant and requires only minimal system resources.\n\n\n## Features\n\n  * Use [Google](https://developers.google.com/identity/protocols/OAuth2) or [GitHub](https://developer.github.com/v3/oauth/) OAuth2 authentication to provide a simple login mechanism for your application.\n  * Quick setup with [Docker](https://www.docker.com/) and [docker-compose](https://docs.docker.com/compose/). With support for development and production environments.\n  * Based on [Lapis](http://leafo.net/lapis) and [Nginx/OpenResty](https://openresty.org/en/).\n\n\n## Getting started\n\n  * Install (if you don't have them):\n    * [Docker](https://www.docker.com/)\n    * [docker-compose](https://docs.docker.com/compose/)\n  * Setup required [environment variables](#environment-variables)\n  * Run in _development_ mode:\n    * Run the application with `docker-compose -f docker-compose-dev.yml up`\n  * Run in _production_ mode:\n    * Run the application with `docker-compose up`\n  * Once `micro-auth` is running, you can point your login to one of the following urls (URLs are for development mode):\n    * `http://localhost:8080/auth/github`: For GitHub login\n    * `http://localhost:8080/auth/google`: For Google login\n\n\n## Authentication Services\n\n### Google\n\n**Setup**\n\nVisit [Google Developers Console](https://console.developers.google.com) and create a new application on Google.\nThen go to [Credentials](https://console.developers.google.com/apis/credentials) and create a new _OAuth Client ID_.\nNow, get the _Client ID_ and _Client secret_.\n\n**Endpoints**\n\n  * `http://localhost:8080/auth/google`: Endpoint for Google authentication. Point your application to this endpoint to login with Google.\n\n**Results**\n\nAfter successful authentication with Google the user is redirect to the URL specified in `GOOGLE_REDIRECT_URL` with the access token saved in the `access_token` query parameter.\n\n### GitHub\n\n**Setup**\n\nVisit [GitHub](https://github.com/settings/applications/new) and create a new application on GitHub to get your client id and secret.\n\n**Endpoints**\n\n  * `http://localhost:8080/auth/github`: Endpoint for GitHub authentication. Point your application to this endpoint to login with Github.\n\n**Results**\n\nAfter successful authentication with GitHub the user is redirect to the URL specified in `GITHUB_REDIRECT_URL` with the access token saved in the `access_token` query parameter.\n\n\n## Environment variables\n\nTo use the service you must set some required environment variables. These variables can be set in the `.env` file. Just copy `.env.example` to `.env`\n\n```\n$ cp .env.example .env\n```\n\nend set the required variables.\n\n## Secrets in docker swarm\nSetting the above environment variables with `_FILE` pointed at the secret mount inside the container. `-e GOOGLE_SECRET_FILE=/run/secrets/google_secret`. This will set the contents on the file as the value of the environment variable.\n\n### General\n\n  * `APP_URL`: Specify the URL of `micro-auth` (default: `http://localhost:8080` in development mode). The `APP_URL` must be set in production mode.\n\n### Google\n\n  * `GOOGLE_CLIENT_ID`: The Google application client id (required)\n  * `GOOGLE_CLIENT_SECRET`: The Google application client secret (required)\n  * `GOOGLE_REDIRECT_URL`: The url to redirect the user once the authentication was successful\n\n### GitHub\n\n  * `GITHUB_CLIENT_ID`: The GitHub application client id (required)\n  * `GITHUB_CLIENT_SECRET`: The GitHub application client secret (required)\n  * `GITHUB_REDIRECT_URL`: The url to redirect the user once the authentication was successful\n\n\n## License\n\nSee [LICENSE](./LICENSE)\n\n\n## Credits\n\n  * [micro-github](https://github.com/mxstbr/micro-github)\n","funding_links":[],"categories":["Libraries","Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypebeast%2Fmicro-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhypebeast%2Fmicro-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhypebeast%2Fmicro-auth/lists"}