I set the access token expiration time to `12096001209600`

then,
`drush cr`
```
Exception: DateInterval::__construct(): Unknown or bad format (PT12096001209600S) in /var/www/html/modules/contrib/simple_oauth/src/Plugin/Oauth2GrantManager.php:92
Stack trace:
#0 /var/www/html/modules/contrib/simple_oauth/src/Plugin/Oauth2GrantManager.php(92): DateInterval->__construct('PT1209600120960...')
……
```

I reinstall simple_oauth module to fix this problem

`drush pmu simple_oauth`
`drush en simple_oauth`

Comments

dravenk created an issue. See original summary.

e0ipso’s picture

Title: Too larger access token expiration time cause an error » Add validation to the token expiration configuration
e0ipso’s picture

The configuration shouldn't accept values that break the DateInterval creation.

dravenk’s picture

Version: 8.x-2.x-dev » 8.x-3.x-dev
Category: Bug report » Feature request
Status: Active » Needs work

@e0ipso
How can you sure user wouldn't break DateInterval creation?
The form element should tell people don't do that.

e0ipso’s picture

@dravenk the is a number that is high enough to break the DateInterval creation. I don't know that number, I imagine that being a big part of this issue.

e0ipso’s picture

new DateInterval('PT999999999999S') works
new DateInterval('PT1000000000000S') doesn't work

dravenk’s picture

Status: Needs work » Fixed

The latest test results show that the bug is no longer repeated. I don't know if it's changed, it looks good.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.