Skip to content

Commit

Permalink
refactor!: set default clock skew tolerance to 15 seconds
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Default clock skew tolerance is now set to 15 seconds (previously 0 seconds tolerance). This can be reverted using the `clockTolerance` configuration option.
  • Loading branch information
panva committed Dec 1, 2022
1 parent a66df23 commit 42c00da
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion certification/fapi/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ const fapi = new Provider(ISSUER, {
id_token_signed_response_alg: 'PS256',
request_object_signing_alg: 'PS256',
},
clockTolerance: 5,
features: {
ciba: {
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,7 @@ _**recommendation**_: Only set this to a reasonable value when needed to cover s
_**default value**_:
```js
0
15
```
### conformIdTokenClaims
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ function makeDefaults() {
* recommendation: Only set this to a reasonable value when needed to cover server-side client and
* oidc-provider server clock skew.
*/
clockTolerance: 0,
clockTolerance: 15,

/*
* conformIdTokenClaims
Expand Down
2 changes: 1 addition & 1 deletion test/client_auth/client_auth.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1023,7 +1023,7 @@ describe('client authentication options', () => {
sub: 'client-jwt-secret',
iss: 'client-jwt-secret',
}, this.key, 'HS256', {
expiresIn: -1,
expiresIn: -300,
}).then((assertion) => this.agent.post(route)
.send({
client_assertion: assertion,
Expand Down
2 changes: 1 addition & 1 deletion test/sessions/sessions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('session exp handling', () => {
await this.login();
const session = this.getSession();
const oldSessionId = this.getSessionId();
session.exp = epochTime();
session.exp = epochTime() - 300;

sinon.spy(this.TestAdapter.for('Session'), 'destroy');

Expand Down

0 comments on commit 42c00da

Please sign in to comment.