diff --git a/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts b/deadlock-plugins/deadlock-extension/src/core/keycloakOAuth2DeviceFlowConnection.ts index fc7b8ebc04b09fdbc7449b46c1debb428d482aa7..b9d184a4f6da27cbd6d1abd6330d0bb953a63ac2 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 = '';