Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 3 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ FRAMEWORK_ALMA_API_URL=https://api-na.hosted.exlibrisgroup.com/almaws/v1/
# Keys can be found in LastPass
FRAMEWORK_ALMA_API_KEY=KEY_GOES_HERE
FRAMEWORK_ALMA_SANDBOX_KEY=KEY_GOES_HERE
LIT_TIND_API_KEY=KEY_GOES_HERE
# If pointing to the sandbox the env=sandbox is required in the url
ALMA_JWT_JWKS_URL=https://api-na.hosted.exlibrisgroup.com/auth/out institution code/jwks.json?env=sandbox
Comment thread
davezuckerman marked this conversation as resolved.
Outdated
LIT_TIND_API_KEY=KEY_GOES_HERE
6 changes: 5 additions & 1 deletion app/controllers/concerns/alma_jwt_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
require 'json'

module AlmaJwtValidator
JWKS_URL = 'https://api-na.hosted.exlibrisgroup.com/auth/01UCS_BER/jwks.json'.freeze
# https://developers.exlibrisgroup.com/alma/integrations/token/
# If running against the Alma sandbox the JWKS_URL needs env=sandbox appended to the end of the url
# e.g. https://api-na.hosted.exlibrisgroup.com/auth/01UCS_BER/jwks.json?env=sandbox.
# set ALMA_JWT_JWKS_URL in your .env when running locally against the Alma sandbox
JWKS_URL = ENV.fetch('ALMA_JWT_JWKS_URL', 'https://api-na.hosted.exlibrisgroup.com/auth/01UCS_BER/jwks.json').freeze
EXPECTED_ISS = 'Prima'.freeze

module_function
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/concerns/alma_jwt_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

describe AlmaJwtValidator do
let(:alma_institution_code) { '01UCS_BER' }
let(:jwks_url) { "https://api-na.hosted.exlibrisgroup.com/auth/#{alma_institution_code}/jwks.json" }
let(:jwks_url) { ENV.fetch('ALMA_JWT_JWKS_URL', "https://api-na.hosted.exlibrisgroup.com/auth/#{alma_institution_code}/jwks.json") }
let(:expected_iss) { 'Prima' }

# Generate an EC key pair for testing
Expand Down
Loading