Skip to content

Commit b7ef347

Browse files
committed
allow all hostnames, specify openid scope
1 parent 094af5c commit b7ef347

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

config/environments/development.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,7 @@
6161

6262
# Uncomment if you wish to allow Action Cable access from any origin.
6363
# config.action_cable.disable_request_forgery_protection = true
64+
65+
# # allow access with any hostname
66+
config.hosts.clear
6467
end

lib/oic_client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def initialize(redirect_uri)
2222
# Same value needs to be passed to the #validate method (store in users session)
2323
def auth_uri(nonce)
2424
client.authorization_uri(
25-
scope: %i[profile email],
25+
scope: %i[openid profile email],
2626
state: nonce,
2727
nonce:
2828
)
@@ -43,13 +43,13 @@ def validate(code, nonce)
4343
# id_token = OpenIDConnect::ResponseObject::IdToken.decode(access_token.id_token, public_keys)
4444
id_token = OpenIDConnect::ResponseObject::IdToken.new(JSON::JWT.decode(access_token.id_token, :skip_verification))
4545
id_token.verify!({ client_id: @client_id, issuer: config.issuer, nonce: })
46-
4746
access_token.userinfo!
4847
end
4948

5049
private
5150

5251
def client
52+
# Rack::OAuth2.debug!
5353
@client ||= OpenIDConnect::Client.new(
5454
identifier: @client_id,
5555
secret: @secret,

0 commit comments

Comments
 (0)