omniauth / omniauth-okta

OAuth2 strategy for Okta
MIT License
41 stars 37 forks source link

Incompatible with dotenv #3

Closed evdevdev closed 2 years ago

evdevdev commented 6 years ago

I've noticed a funny issue, which is that the way env vars are used to set constants is incompatible with using dotenv for setting environmental paths.

My hunch is that this has something to do with the way bundler follows requires.

I think the fastest fix would be to eliminate these lines:

      ORG           = ENV['OKTA_ORG']    || 'your-org'
      DOMAIN        = ENV['OKTA_DOMAIN'] || 'okta'
      BASE_URL      = "https://#{ORG}.#{DOMAIN}.com"
      DEFAULT_SCOPE = %[openid profile email].freeze

And instead reference ENV wherever the constants were called.

Thoughts?

wkirschbaum commented 6 years ago

It is incompatible with config files too, there is a PR out: https://github.com/dandrews/omniauth-okta/pull/1. It does not seem like there is any movement on this gem, so maybe add it to your boot.rb file if you are using rails:

# config/boot.rb

ENV['OKTA_ORG'] ||= 'exampleorg'
amseledka commented 5 years ago

hey guys, any progress on that one?

dandrews commented 5 years ago

I merged in #1 but if anyone wants to submit a pull request here it'd be greatly appreciated.

amseledka commented 5 years ago

@dandrews works perfect, thank you!!