Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shogo82148/go-nginx-oauth2-adapter
Add oauth2 authentication layer with ngx_http_auth_request_module
https://github.com/shogo82148/go-nginx-oauth2-adapter
golang h2o nginx oauth2
Last synced: 3 months ago
JSON representation
Add oauth2 authentication layer with ngx_http_auth_request_module
- Host: GitHub
- URL: https://github.com/shogo82148/go-nginx-oauth2-adapter
- Owner: shogo82148
- License: mit
- Created: 2016-03-02T22:16:32.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2024-10-02T02:43:30.000Z (4 months ago)
- Last Synced: 2024-10-14T20:48:29.321Z (3 months ago)
- Topics: golang, h2o, nginx, oauth2
- Language: Go
- Homepage:
- Size: 417 KB
- Stars: 21
- Watchers: 4
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
![test](https://github.com/shogo82148/go-nginx-oauth2-adapter/workflows/test/badge.svg)
# go-nginx-oauth2-adapter
a golang port for [sorah/nginx_omniauth_adapter](https://github.com/sorah/nginx_omniauth_adapter)
## PREREQUISITE
- nginx with ngx_http_auth_request_module, or h2o with mruby
## USAGE
```bash
$ go get github.com/shogo82148/go-nginx-oauth2-adapter/cli/go-nginx-oauth2-adapter
$ go-nginx-oauth2-adapter
```## CONFIGURATION
The example of configuration file.
```yaml
address: ":18081" # listen address# secret tokens to authenticate/encrypt cookie.
# see http://www.gorillatoolkit.org/pkg/sessions for more detail.
# use `-genkey` option to create strong keys.
secrets:
- new-authentication-key
- new-encryption-key
- old-authentication-key
- old-encryption-key
session_name: go-nginx-oauth2-session
app_refresh_interval: 24h# cookie settings for saving session
# the following settings are default value.
# we recommend to use this settings.
cookie:
path: /
domain:
max_age: 259200 # 259200 seconds = 3 days
secure: true
http_only: true
same_site: "lax" # valid values are "default", "lax", "strict", "none"providers:
# development: {} # For test.
google_oauth2:
client_id: YOUR_CLIENT_ID
client_secret: YOUR_CLIENT_SECRET
scopes: "openid,email,profile" # default: "openid,email,profile"
restrictions:
- example.com # domain of your Google App
- [email protected]
```## LICENSE
This software is released under the MIT License, see LICENSE.md.
## SEE ALSO
- [sorah/nginx_omniauth_adapter](https://github.com/sorah/nginx_omniauth_adapter)
- [nginx で omniauth を利用してアクセス制御を行う(written in Japanese)](http://techlife.cookpad.com/entry/2015/10/16/080000)