New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Omniauth OAuth redirect_uri_mismatch when https is used #723
Comments
Thanks @madd86 ! |
@madd86 that's what I did. The other thing is just the workaround so that it works |
Hi @schurig - ups. Hit the button to early 😁 I analyzed the behavior and can reproduce the issue you are having. Sadly it's out of the Zammad scope (done by Ominauth) so we can't provide a direct fix. Nevertheless we will analyze it further to find the best solution to get it to work. How to reproduce:
Current state: Seems some of those RACK ENVs are not set properly. Should be checked if we can influence this via the NGINX conf or if we have to do it somehow in the Rails context. |
Hi @schurig - I think I got it! Are you running with an NGINX installation? If so please update your configuration and add these two lines:
Restart your NGINX and Zammad and let me know. Apache should be these lines:
For the record: I dumped the rack.envs via an initializer overwriting the Omniauth ssl detection in a new rails initializer Rails.application.config.to_prepare do # to_prepare ensures that the monkey patching happens before the first request
OmniAuth::Strategy.class_eval do # reopen the class
protected
def ssl? # redefine the ssl? method
# DEBUG/CUSTOMIZATION
File.write('/tmp/omniauth.log', request.env.inspect)
# DEBUG/CUSTOMIZATION
request.env['HTTPS'] == 'on' ||
request.env['HTTP_X_FORWARDED_SSL'] == 'on' ||
request.env['HTTP_X_FORWARDED_SCHEME'] == 'https' ||
(request.env['HTTP_X_FORWARDED_PROTO'] && request.env['HTTP_X_FORWARDED_PROTO'].split(',')[0] == 'https') ||
request.env['rack.url_scheme'] == 'https'
end
end
end And none of the checked vars were set. |
This was the problem! Thanks!! 😍 ❤️ |
Thanks for the feedback! Commit is on its way. 🚀 up to the next issue. |
Try this answer it worked with me |
@salmagomaa this does not solve the problem and was a Bug within Zammad. |
Infos:
Expected behavior:
Actual behavior:
Steps to reproduce the behavior:
https
Known workaround
redirect
http
tohttps
in nginx and use the http version of the url as callback url in the github oauth app setting(related to #647)
The text was updated successfully, but these errors were encountered: