Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

misc(IDToken): Increase default max_age constant (token timeout) #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion src/AccessToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {JWT} = require('@trust/jose')
const crypto = require('@trust/webcrypto')
const AccessTokenSchema = require('./schemas/AccessTokenSchema')

const DEFAULT_MAX_AGE = 3600 // Default Access token expiration, in seconds
const DEFAULT_MAX_AGE = 1209600 // Default Access token expiration, in seconds
const DEFAULT_SIG_ALGORITHM = 'RS256'

/**
Expand Down
2 changes: 1 addition & 1 deletion src/IDToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const base64url = require('base64url')
const {JWT} = require('@trust/jose')
const IDTokenSchema = require('./schemas/IDTokenSchema')

const DEFAULT_MAX_AGE = 3600 // Default ID token expiration, in seconds
const DEFAULT_MAX_AGE = 1209600 // Default ID token expiration, in seconds
const DEFAULT_SIG_ALGORITHM = 'RS256'

/**
Expand Down
6 changes: 3 additions & 3 deletions test/AccessTokenSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('AccessToken', () => {
var provider

before(function () {
this.timeout(5000)
this.timeout(10000)

let configPath = path.join(__dirname, 'config', 'provider.json')

Expand Down Expand Up @@ -82,7 +82,7 @@ describe('AccessToken', () => {
return AccessToken.issueForRequest(request, response)
.then(res => {
expect(res['token_type']).to.equal('Bearer')
expect(res['expires_in']).to.equal(3600)
expect(res['expires_in']).to.equal(1209600)

return JWT.decode(res['access_token'])
})
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('AccessToken', () => {
return AccessToken.issueForRequest(request, response)
.then(res => {
expect(res['token_type']).to.equal('Bearer')
expect(res['expires_in']).to.equal(3600)
expect(res['expires_in']).to.equal(1209600)

return JWT.decode(res['access_token'])
})
Expand Down
2 changes: 1 addition & 1 deletion test/handlers/AuthenticationRequestSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ describe('AuthenticationRequest', () => {
return request.allow(request)
.then(response => {
expect(response.token_type).to.equal('Bearer')
expect(response.expires_in).to.equal(3600)
expect(response.expires_in).to.equal(1209600)
expect(response.id_token).to.exist()
expect(response.id_token.split('.').length).to.equal(3)
expect(response.access_token).to.exist()
Expand Down