Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ IAM_COMMUNITY_CLAIM_NAME=
IAM_COMMUNITY_ROLE_ADMIN=
IAM_COMMUNITY_ROLE_PUBLISHER=
IAM_COMMUNITY_ROLE_READER=
IAM_ISSUER=
IAM_URL=
SECRET_KEY_BASE=[secret key string for signed cookies]
8 changes: 6 additions & 2 deletions app/services/parse_iam_access_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def decoded_token # rubocop:todo Metrics/AbcSize, Metrics/MethodLength
{
algorithm: matching_key['alg'],
verify_iat: true,
verify_iss: true,
iss: iam_realm_url
verify_iss: iam_issuer.present?,
iss: iam_issuer
}
)[0]
end
Expand Down Expand Up @@ -124,6 +124,10 @@ def fetch_env_var(name)
raise "#{name} env variable is missing"
end

def iam_issuer
ENV.fetch('IAM_ISSUER', nil)
end

def iam_realm_url
fetch_env_var('IAM_URL')
end
Expand Down
Loading