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:
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.
GitHub OAuth Setup Guide | Coder Docs
Set up GitHub OAuth for Coder, enabling GitHub and GitHub Enterprise authentication with OAuth app configuration and Helm deployment steps.
10 Replies
<#1359758339604484310>
Category
Help needed
Product
Coder (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Hey @Phorcys , can you please help me out on this one? 🙏
taking a look in a sec @uv.panta
does it work if you undefine
CODER_OAUTH2_GITHUB_ALLOWED_ORGS
?on another note, have you granted access to that org when logging in?

Yes, it works when I undefine CODER_OAUTH2_GITHUB_ALLOWED_ORGS. And yes, granted access to the org.
Thanks @Phorcys
alright
set
CODER_VERBOSE=true
and look at the logs when logging inAhh okay, let me try that.
it'll allow you to see the data from the OIDC claims and hopefully help you figure out what's wrong
look for "got oidc claims"
https://coder.com/docs/admin/users/oidc-auth#oidc-claims
Hey @Phorcys sorry for the delay. I do not get organizations & teams option when I try to authenticate.
This is what my auth screen from github looks like. Is there any sepcific permission I need to enable in Github?

All good. TIL I need to install the app to the organisation (not just creating it) 😬