-
Notifications
You must be signed in to change notification settings - Fork 188
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
Dynamic client_options.redirect_uri value #170
Comments
Hey, Did you get any luck with this ? |
@mazoonit yes, so i ended up just doing a monkey patch of the library with this : module OmniAuth
module Strategies
# Override of the OpenIDConnect strategy to include the query string in the redirect_uri
class OpenIDConnect
# override of the redirect_uri method to include to dynamically detect the correct redirect_uri
def redirect_uri
callback_url
end
end
end
end |
@Ksm125 Ended up doing the same yes to append custom state variable to the query string. module OmniAuth
module Strategies
class Custom < OmniAuth::Strategies::OpenIDConnect
option :name, 'custom'
def new_state
state = if options.state.respond_to?(:call)
if options.state.arity == 1
options.state.call(env)
else
options.state.call
end
end
if request.params['state']
state = request.params['state']
end
session['omniauth.state'] = state || SecureRandom.hex(16)
end
end
end
end Thanks 🚀 |
There should be a way to have a dynamic value for the
redirect_uri
value as the app hostname is not known at the configuration level.The default
OmniAuth
strategy uses the methodcallback_url
for example.full_host + callback_path + query_string
The text was updated successfully, but these errors were encountered: