{"id":20252462,"url":"https://github.com/ivandotv/grant-server","last_synced_at":"2025-04-10T23:16:50.971Z","repository":{"id":37024257,"uuid":"275238153","full_name":"ivandotv/grant-server","owner":"ivandotv","description":"This module is a packaged Grant OAuth proxy server. That means that you can just install this package and run grant-serve to have a proxy OAuth server running. Docker image is also available.","archived":false,"fork":false,"pushed_at":"2024-11-14T19:29:53.000Z","size":691,"stargazers_count":5,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T23:16:35.039Z","etag":null,"topics":["docker-image","oauth","oauth2","oauth2-server","proxy","proxy-oauth-server"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/ivandotv.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-26T20:05:38.000Z","updated_at":"2023-03-08T22:41:01.000Z","dependencies_parsed_at":"2024-02-16T01:35:02.393Z","dependency_job_id":"e03e664b-4d10-43c3-97f9-8df20b0ebbf1","html_url":"https://github.com/ivandotv/grant-server","commit_stats":{"total_commits":131,"total_committers":4,"mean_commits":32.75,"dds":0.4961832061068703,"last_synced_commit":"b6303f3fb904f6586ece7f0a5fbbf888f7ad8486"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fgrant-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fgrant-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fgrant-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fgrant-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivandotv","download_url":"https://codeload.github.com/ivandotv/grant-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312133,"owners_count":21082638,"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":["docker-image","oauth","oauth2","oauth2-server","proxy","proxy-oauth-server"],"created_at":"2024-11-14T10:16:55.747Z","updated_at":"2025-04-10T23:16:50.951Z","avatar_url":"https://github.com/ivandotv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grant Server\n\n![Codecov](https://img.shields.io/codecov/c/github/ivandotv/grant-server)\n![CI](https://github.com/ivandotv/grant-server/workflows/Unit%20tests/badge.svg)\n[![semantic release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)\n\nThis module is a packaged [Grant OAuth proxy server](https://github.com/simov/grant). That means that you can just install this package and run `grant-serve` to have a proxy OAuth server running.\n\n## Install\n\n```js\nnpm install grant-server\n```\n\nrun it:\n\n```js\ngrant-serve\n```\n\n## Table of Contents\n\n- [How it works](#how-it-works)\n- [Command line options](#command-line-options)\n- [Docker image](#docker-image)\n- [Docker usage](#docker-usage)\n\n## How it works\n\nAfter installing, you will need a [grant configuration file](https://github.com/simov/grant#configuration) to set up different OAuth providers. By default, the module looks for `grant.config.json` file in the currently executing directory. The server will automatically watch for changes in the configuration file and it will automatically reload.\n\nexample configuration file with Google auth:\n\n```json\n{\n  \"defaults\": {\n    \"origin\": \"http://localhost:3000\",\n    \"prefix\": \"/oauth\"\n  },\n  \"google\": {\n    \"key\": \"CLIENT_ID\",\n    \"secret\": \"CLIENT_SECRET\",\n    \"callback\": \"https://redirect-user-to-your-app.com\",\n    \"scope\": [\"openid\"]\n  }\n}\n```\n\nBy using the file above we are enabling google OAuth point on `http://localhost:3000/oauth/google`, and we are asking for `OpenID` scope. After the tokens have been acquired, the caller will be redirected to `https://redirect-user-to-your-app.com` with the tokens available via query parameters.\n\n## Command line options\n\n- `-c` or `--config` Grant configuration file. If not provided, by default server will look for `grant.config.json` in the currently executing directory.\n\n- `-d` or `--debug` Enable writing tokens to `stdout`. It uses [request-logs module](https://github.com/simov/request-logs). If only the flag is passed it will default to `res,json` otherwise you can customize what the output will be e.g. `-d res,req,json,body`\n\n- `p` or `--proxy` By default internal `express` app will have `trust proxy` flag set to `true`. You can pass in `false` to disable the proxy. Or use any of the options supported by the [express app](http://expressjs.com/en/api.html#trust.proxy.options.table)\n\n## Docker image\n\nDocker image is available on [docker hub](https://hub.docker.com/repository/docker/ivandotv/grant-server). Image is based on github releases, so it's always up to date.\n\n### Docker usage\n\nPull the image:\n\n```bash\ndocker image pull ivandotv/grant-server\n```\n\nRun the container:\n\n```bash\ndocker run -it -v /config-dir:/opt/grant-server/config-dir ivandotv/grant-server -d -c config/config.json\n```\n\nFew things to keep in mind when using the docker image.\n\n- Server is started in `/opt/grant-server` directory inside the container.\n- Make sure that the exposed port is the same as in the configuration file.\n- If you mount only the external config file: `-v config.json:/opt/grant-server/config.json` Automatic reloading of the server will not work, because the server will not **see** the changes in the file.\n  Better option is to mount the **directory** where configuration file is located: `-v /config-dir:/opt/grant-server/config-dir` and then pass the `-c` flag to the container like so: `-c config/config.json`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivandotv%2Fgrant-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivandotv%2Fgrant-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivandotv%2Fgrant-server/lists"}