hello @dcech, I updated my original post with a bit more of my configuration data.
This problem started occuring after I upgraded from 4.6.3 to 5.1.1. I originally upgraded because of the github oauth bug regarding organizations present in earlier versions before 5.0.
Did you configure Authorization callback URL for your test/dev Grafana domain+path?
You may try to exchange obtained code for a token with curl to see response from GitHub directly - error message should be there. Curl example:
It looks like it’s failing here: https://github.com/golang/oauth2/blob/6881fee410a5daf86371371f9ad451b95e168b71/internal/token.go#L256 (test has been added 4 months ago). It’s not able to parse access_token. I don’t know why. You may try to add some debugging lines into Go code to see raw GitHub response and parsed access_token values, just to debug golang/oauth2 RetrieveToken() function. Of course, you will need to build your own Grafana binary.
After looking into that code in the oauth2 library I did notice that the response header for content-type does not full text match the expected cases inside the oauth2 package.
Notice that the response header contains the charset for content-type? I’m not sure if go’s mime library correctly parses out that data string before it does the comparison in the switch case.
I am also totally bewildered by the fact that no one else seems to be experiencing this issue when using github login.
I am running into the same problem as described by @chancelarkst.
My grafana is sitting behind an instance of HAProxy. I’ve verified with curl that I can obtain a token from github. This problem seems present in older versions as well as new ones. The issue is occurring when the docker container running grafana is exposed to the internet and when it is behind a load balancer.
I got the same error. I am using ingress-nginx with grafana behind in k8s. I can get access_token using curl, but getting
login.OAuthLogin(missing saved state) inside grafana.
I set cookie_samesite = lax, domain = my.ingress.route, root_url = https://my.ingress.route and cookie_secure = true.
Any updates?