Coder.comC
Coder.com10mo ago
15 replies
uv.panta

github oauth always throwing error when used with organisation option enabled

Hey all,
need a bit of help here because I'm out of all options now.
I'm trying to set up GitHub for user authentication following this guide:
https://coder.com/docs/admin/users/github-auth
What I did was:
- Created a GitHub App for my organisation
- Used the client ID & Secret to set coder's environment variables. Here's what my env looks like:
CODER_PORT=tcp://**.**.**.**:80
KUBERNETES_SERVICE_PORT_HTTPS=443
CODER_OAUTH2_GITHUB_CLIENT_SECRET=***
KUBERNETES_SERVICE_PORT=443
KUBE_POD_IP=**.**.**.**
CODER_DERP_SERVER_RELAY_URL=http://*.*.*.*:8080
CODER_ACCESS_URL=https://coder.example.com
HOSTNAME=coder-66c8d6f7f6-nd8qn
CODER_PORT_80_TCP_PORT=80
CODER_PORT_80_TCP_PROTO=tcp
CODER_OAUTH2_GITHUB_DEVICE_FLOW=false
PWD=/home/coder
CODER_PROMETHEUS_ADDRESS=0.0.0.0:2112
CODER_OAUTH2_GITHUB_ALLOWED_ORGS="My-Organisation"
CODER_SERVICE_PORT_HTTP=80
CODER_WILDCARD_ACCESS_URL=https://*.coder.example.com
HOME=/home/coder
KUBERNETES_PORT_443_TCP=tcp://**.**.**.**:443
CODER_SERVICE_PORT=80
CODER_SERVICE_HOST=*.*.*.*
TERM=xterm
CODER_HTTP_ADDRESS=**.**.**.**:8080
CODER_OAUTH2_GITHUB_CLIENT_ID=***
SHLVL=2
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP_ADDR=**.**.**.**
CODER_PORT_80_TCP_ADDR=**.**.**.**
CODER_OAUTH2_GITHUB_ALLOW_SIGNUPS=true
_=/usr/bin/env


Now, when I try to login, this is what I get:
You aren't a member of the authorized GitHub organizations!

I've double-checked I'm a member as well as owner of the github organisation. I'm not sure if there's something I'm doing wrong or this is some sort of bug.
Coder version is: v2.21.0

Any response would be appreciated.
Set up GitHub OAuth for Coder, enabling GitHub and GitHub Enterprise authentication with OAuth app configuration and Helm deployment steps.
GitHub OAuth Setup Guide | Coder Docs
Preview image
Was this page helpful?