Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bjarocki/oauth2-nginx-auth-backend
https://github.com/bjarocki/oauth2-nginx-auth-backend
auth-request nginx oauth2 slack-api
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/bjarocki/oauth2-nginx-auth-backend
- Owner: bjarocki
- Created: 2017-07-05T12:25:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T15:01:34.000Z (almost 2 years ago)
- Last Synced: 2024-04-26T07:02:13.671Z (6 months ago)
- Topics: auth-request, nginx, oauth2, slack-api
- Language: Ruby
- Size: 98.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nginx Configuration
### /etc/nginx/oauth2-auth.conf
```
auth_request /oauth2/verify;
error_page 401 = https://auth.example.com/oauth2/sign_in;
auth_request_set $auth_cookie $upstream_http_set_cookie;
add_header Set-Cookie $auth_cookie;```
### /etc/nginx/oauth2-location.conf
```
location /oauth2/ {
proxy_method GET;
proxy_pass http://127.0.0.1:3000;
proxy_set_header Content-Length "";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $scheme://$server_name$request_uri;
}```
### /etc/oauth2/oauth2.conf example
```
{
"auth": {
"cookie_domain": ".devops.dance",
"cookie_name_permissions": "DDIntranetPermissions",
"cookie_name_redirect": "DDIntranetRedirect",
"cookie_name_signature": "DDIntranetSignature",
"cookie_ttl": 86400,
"default_redirect_page": "https://oauth.devops.dance/",
"oauth_shared_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
},
"google": {
"oauth_client_id": "XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com",
"oauth_client_secret": "XXXXXXXXXXXXXXXXXXXXXXXX",
"oauth_redirect_url": "https://oauth.devops.dance/oauth2/google/authorize",
"oauth_server_url": "https://oauth.devops.dance/",
"whitelisted_domains": [
"smatly.com"
],
"whitelisted_emails": []
},
"slack": {
"oauth_client_id": "XXXXXXXXXXXXXXXXXXXXXXXXX",
"oauth_client_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"oauth_redirect_url": "https://oauth.devops.dance/oauth2/slack/authorize",
"whitelisted_domains": [
"devops-dance"
]
}
}
```