@@ -20,6 +20,15 @@ Or install it yourself as:
20
20
$ gem install omniauth-okta
21
21
```
22
22
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
+
23
32
### OmniAuth
24
33
25
34
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`.
37
46
Configuration options can be passed as the last parameter here as key/value pairs.
38
47
39
48
``` ruby
40
- config.omniauth :okta , ' OKTA_CLIENT_ID' , ' OKTA_CLIENT_SECRET' , {}
49
+ config.omniauth :okta , ENV [ ' OKTA_CLIENT_ID' ], ENV [ ' OKTA_CLIENT_SECRET' ] , {}
41
50
```
42
51
or add options like the following:
43
52
44
53
``` ruby
45
54
require ' omniauth-okta'
46
55
config.omniauth(:okta ,
47
- < OKTA_CLIENT_ID > ,
48
- < OKTA_CLIENT_SECRET > ,
56
+ ENV [ ' OKTA_CLIENT_ID' ] ,
57
+ ENV [ ' OKTA_CLIENT_SECRET' ] ,
49
58
:scope => ' openid profile email' ,
50
59
:fields => [' profile' , ' email' ],
51
60
:strategy_class => OmniAuth ::Strategies ::Okta )
@@ -101,7 +110,7 @@ Here's an example of an authentication hash available in the callback by accessi
101
110
" id_token" => " TOKEN" ,
102
111
" id_info" => {
103
112
" ver" => 1 ,
104
- " jti" => " AT.Dr2slfkj34wsdfsds2xw2584l3on090sldkfj " ,
113
+ " jti" => " AT.D2sslkfjdsldjf899n090sldkfj " ,
105
114
" iss" => " https://your-org.okta.com" ,
106
115
" aud" => " https://your-org.okta.com" ,
107
116
" sub" => " john@example.com" ,
0 commit comments