From 0350d4b50e5ed771c55c8b512f04bdbc904b9bc0 Mon Sep 17 00:00:00 2001 From: Christian Zheng <czheng@takima.fr> Date: Tue, 26 Apr 2022 11:35:38 +0200 Subject: [PATCH] docs(login): add explanation for waiting duration --- .../src/core/keycloakOAuth2DeviceFlowConnection.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts b/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts index fc7b8ebc..b9d184a4 100644 --- a/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts +++ b/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts @@ -14,6 +14,14 @@ export default class KeycloakOAuth2DeviceFlowConnection { private deviceAuthorizationRequestResponseData: DeviceAuthorizationRequestResponseData; constructor(private deviceUrl: string, private tokenUrl: string, private userInfoUrl: string) { + /* + * Arbitrary durations to wait in seconds \ + * Waiting time between requests should be increasing + * if Keycloak api reponds with error code `slow_down` \ + * otherwise, it will continue to respond with this error code. \ + * The minimal waiting duration has been chosen to not be too short: \ + * Keycloak may saturate and crash due to too many requests. + */ this.waitDuration = new WaitDuration([5_000, 5_000, 5_000, 10_000, 10_000, 10_000, 30_000, 30_000, 100_000]); this.accessToken = ''; this.refreshToken = ''; -- GitLab