Skip to content
Open
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
5 changes: 4 additions & 1 deletion lib/oidc/endpoints/well-known.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ export function getKey(sdk: OktaAuthOAuthInterface, issuer: string, kid: string)

// Pull the latest keys if the key wasn't in the cache
return get(sdk, jwksUri, {
cacheResponse: true
cacheResponse: true,
headers: {
'Cache-Control': 'no-cache, no-store, max-age=0'
}
})
.then(function(res) {
var key = find(res.keys, {
Expand Down
24 changes: 21 additions & 3 deletions test/spec/oidc/endpoints/well-known.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,13 @@ describe('getKey', function() {
{
request: {
method: 'get',
uri: '/oauth2/v1/keys'
uri: '/oauth2/v1/keys',
headers: {
'Cache-Control': 'no-cache, no-store, max-age=0',
'Accept': 'application/json',
"Content-Type": "application/json",
'X-Okta-User-Agent-Extended': global['USER_AGENT'],
}
},
response: 'keys'
}
Expand Down Expand Up @@ -411,7 +417,13 @@ describe('getKey', function() {
{
request: {
method: 'get',
uri: '/oauth2/v1/keys'
uri: '/oauth2/v1/keys',
headers: {
'Cache-Control': 'no-cache, no-store, max-age=0',
'Accept': 'application/json',
"Content-Type": "application/json",
'X-Okta-User-Agent-Extended': global['USER_AGENT'],
}
},
response: 'keys'
}
Expand Down Expand Up @@ -467,7 +479,13 @@ describe('getKey', function() {
{
request: {
method: 'get',
uri: '/oauth2/v1/keys'
uri: '/oauth2/v1/keys',
headers: {
'Cache-Control': 'no-cache, no-store, max-age=0',
'Accept': 'application/json',
"Content-Type": "application/json",
'X-Okta-User-Agent-Extended': global['USER_AGENT'],
}
},
response: 'keys'
}
Expand Down