dex/server
Kyle Larose ab5ea03025
handlers: do not fail login if refresh token gone
There is a chance that offline storage could fall out of sync with the
refresh token tables. One example is if dex crashes/is stopped in the
middle of handling a login request. If the old refresh token associated
with the offline session is deleted, and then the process stops, the
offline session will still refer to the old token.

Unfortunately, if this case occurs, there is no way to recover from it,
since further logins will be halted due to dex being unable to clean up
the old tokens till referenced in the offline session: the database is
essentially corrupted.

There doesn't seem to be a good reason to fail the auth request if the
old refresh token is gone. This changes the logic in `handleAuthCode` to
not fail the entire transaction if the old refresh token could not be
deleted because it was not present. This has the effect of installing
the new refresh token, and unpdating the offline storage, thereby fixing
the issue, however it occured.
2020-03-18 12:56:37 -04:00
..
internal regenerate protobuf code 2019-07-31 08:16:18 +02:00
api.go Fix whitespace 2019-12-18 15:56:12 +01:00
api_test.go Fix whitespace 2019-12-18 15:56:12 +01:00
doc.go initial commit 2016-07-26 15:51:24 -07:00
handlers.go handlers: do not fail login if refresh token gone 2020-03-18 12:56:37 -04:00
handlers_test.go Fix whitespace 2019-12-18 15:56:12 +01:00
oauth2.go Add support for password grant #926 2020-01-10 13:18:09 -05:00
oauth2_test.go Use connector_id param to skip directly to a specific connector 2019-07-22 10:47:11 -05:00
rotation.go *: fix some lint issues 2019-07-30 11:29:08 +02:00
rotation_test.go Remove the logrus logger wrapper 2019-02-22 21:31:46 +01:00
server.go Merge pull request #1515 from flant/atlassian-crowd-connector 2020-02-24 10:09:27 +01:00
server_test.go Fix bodyclose 2019-12-18 16:04:03 +01:00
templates.go Merge pull request #1576 from flant/icons-proposal 2019-12-23 13:05:19 +01:00
templates_test.go templates: add new relativeURL function 2019-10-02 17:08:06 +03:00