Closed thepratt closed 1 year ago
Setup a new phoenix project using dependencies and a new github OAuth2 project
{:ueberauth_github, github: "ueberauth/ueberauth_github", tag: "v0.8.2"}, {:ueberauth, "== 0.10.3"},
emulate route/controlelr setup in https://github.com/ueberauth/ueberauth_example
attempt to log in with github
To have an authenticated result.
The workaround is to append headers picked up by the OAuth client to the config. Should this be copy added to the readme to help new users with setup or an explicit default+override always sent - as GitHub now looks for this header?
config :ueberauth, Ueberauth.Strategy.Github.OAuth, ... headers: [ "user-agent": "something" ]
%OAuth2.Response{ status_code: 403, headers: [ {"cache-control", "no-cache"}, {"connection", "close"}, {"content-type", "text/html; charset=utf-8"}, {"strict-transport-security", "max-age=31536000"}, {"x-content-type-options", "nosniff"}, {"x-frame-options", "deny"}, {"x-xss-protection", "0"}, {"content-security-policy", "default-src 'none'; style-src 'unsafe-inline'"} ], body: "\r\nRequest forbidden by administrative rules. Please make sure your request has a User-Agent header (https://docs.github.com/en/rest/overview/resources-in-the-rest-api#user-agent-required). Check https://developer.github.com for other possible causes.\r\n" }
Links to https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required
The error has been hidden by https://github.com/ueberauth/ueberauth_github/blob/master/lib/ueberauth/strategy/github.ex#L267 , which should probably also be logged.
Is this still maintained? i stumbled across the same exact problem
Steps to Reproduce
Setup a new phoenix project using dependencies and a new github OAuth2 project
emulate route/controlelr setup in https://github.com/ueberauth/ueberauth_example
attempt to log in with github
Expected Result
To have an authenticated result.
The workaround is to append headers picked up by the OAuth client to the config. Should this be copy added to the readme to help new users with setup or an explicit default+override always sent - as GitHub now looks for this header?
Actual Result
Links to https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#user-agent-required
The error has been hidden by https://github.com/ueberauth/ueberauth_github/blob/master/lib/ueberauth/strategy/github.ex#L267 , which should probably also be logged.