Skip to content

Commit 992ee0a

Browse files
committed
README environment variables
1 parent 15fa2b5 commit 992ee0a

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@ Or install it yourself as:
2020
$ gem install omniauth-okta
2121
```
2222

23+
### Environment Variables
24+
25+
```bash
26+
OKTA_CLIENT_ID # required
27+
OKTA_CLIENT_SECRET # required
28+
OKTA_ORG # required - defaults to 'your-org' if unset
29+
OKTA_DOMAIN # optional - defaults to 'okta.com' if unset
30+
```
31+
2332
### OmniAuth
2433

2534
Here's an example for adding the middleware to a Rails app in `config/initializers/omniauth.rb`:
@@ -37,15 +46,15 @@ First define your application id and secret in `config/initializers/devise.rb`.
3746
Configuration options can be passed as the last parameter here as key/value pairs.
3847

3948
```ruby
40-
config.omniauth :okta, 'OKTA_CLIENT_ID', 'OKTA_CLIENT_SECRET', {}
49+
config.omniauth :okta, ENV['OKTA_CLIENT_ID'], ENV['OKTA_CLIENT_SECRET'], {}
4150
```
4251
or add options like the following:
4352

4453
```ruby
4554
require 'omniauth-okta'
4655
config.omniauth(:okta,
47-
<OKTA_CLIENT_ID>,
48-
<OKTA_CLIENT_SECRET>,
56+
ENV['OKTA_CLIENT_ID'],
57+
ENV['OKTA_CLIENT_SECRET'],
4958
:scope => 'openid profile email',
5059
:fields => ['profile', 'email'],
5160
:strategy_class => OmniAuth::Strategies::Okta)
@@ -101,7 +110,7 @@ Here's an example of an authentication hash available in the callback by accessi
101110
"id_token" => "TOKEN",
102111
"id_info" => {
103112
"ver" => 1,
104-
"jti" => "AT.Dr2slfkj34wsdfsds2xw2584l3on090sldkfj",
113+
"jti" => "AT.D2sslkfjdsldjf899n090sldkfj",
105114
"iss" => "https://your-org.okta.com",
106115
"aud" => "https://your-org.okta.com",
107116
"sub" => "john@example.com",

0 commit comments

Comments
 (0)