-
Notifications
You must be signed in to change notification settings - Fork 38
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
Allow for OmniAuth 2.0 series #6
Conversation
* One of the breaking changes in OmniAuth 2.0+ relates to how relative URL installations are handled. See: omniauth/omniauth#903 and https://github.com/omniauth/omniauth/wiki/Upgrading-to-2.0#relative-root-apps * As a result, when `azure_activedirectory_v2` is used with OmniAuth 2.0+ for an app that lives at a relative URl, the `#callback_url` is incorrect (the relative URL is included twice). * This is because OmniAuth is now prefixing the default Strategy#request_path and Strategy#callback_path with SCRIPT_NAME, but `azure_activedirectory_v2` is also adding `script_name` to `callback_url`. * This update makes this gem compatible with OmniAuth 2.0+ but will break relative URL installatons for OmniAuth 1.x so I've also updated the gemspec to rely on a version of omniauth-oauth2 that has a dependency on omniauth 2.0: omniauth/omniauth-oauth2#152 (comment) * Similar change to omniauth-google-oauth2 was made here: zquestz/omniauth-google-oauth2#403
it 'should set the callback path with script_name if present' do | ||
allow(subject).to receive(:full_host) { base_url } | ||
allow(subject).to receive(:script_name) { '/v1' } | ||
expect(subject.callback_url).to eq(base_url + '/v1/auth/azure_activedirectory_v2/callback') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -45,5 +45,5 @@ Gem::Specification.new do |s| | |||
'source_code_uri' => 'https://github.com/RIPGlobal/omniauth-azure-activedirectory-v2' | |||
} | |||
|
|||
s.add_runtime_dependency('omniauth-oauth2', '~> 1.7') | |||
s.add_runtime_dependency('omniauth-oauth2', '~> 1.8') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this means that the gem is now dependent on omniauth 2.0. omniauth/omniauth-oauth2#152 (comment)
Thanks @jessieay have bumped the version and pushed up to Rubygems - https://rubygems.org/gems/omniauth-azure-activedirectory-v2/versions/2.0.0 |
Thanks so much for merging and bumping @whithajess ! Much appreciated |
azure_activedirectory_v2
is used with OmniAuth 2.0+ for an app that lives at a relative URl, the#callback_url
is incorrect (the relative URL is included twice).azure_activedirectory_v2
is also addingscript_name
tocallback_url
.on omniauth 2.0: Use omniauth 2.x to ensure latest security updates omniauth/omniauth-oauth2#152 (comment)