You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Dec 4, 2023. It is now read-only.
[PORT] [Authentication] Gov: Support temporary service unavailable results. #507
This needs more research. This has to do with retries to exceptions using Adal in C#. But Java uses MSAL and may (or may not) have the same abilities to provide the same functionality.
CredentialsAuthenticator.acquireToken might look something like this:
public CompletableFuture<IAuthenticationResult> acquireToken() {
return Retry.run(() -> app.acquireToken(parameters)
.exceptionally(
exception -> {
// wrapping whatever msal throws into our own exception
throw new AuthenticationException(exception);
}
),
(exception, count) -> {
if (exception instanceof RetryException) {
if (exception.getCause() instanceof MsalServiceException) {
MsalServiceException serviceException = (MsalServiceException) exception.getCause();
if (StringUtils.equals(
serviceException.errorCode(),
"temporarily_unavailable"
)) {
List<String> header = serviceException.headers().get("Retry-After");
if (header.isEmpty()) {
return RetryParams.defaultBackOff(count);
}
// need to parse Retry-After header value for Date or Delta and use
// that as the Retry backoff.
// For now, retry with default backoff.
}
return RetryParams.defaultBackOff(count);
}
}
return RetryParams.stopRetrying();
});
}
changed the title [-][PORT] [Authentication] updates to support Arlington[/-][+][PORT] [Authentication] Gov: Support temporary service unavailable results.[/+]on Feb 2, 2021
Activity
tracyboehrer commentedon Jan 15, 2021
This needs more research. This has to do with retries to exceptions using Adal in C#. But Java uses MSAL and may (or may not) have the same abilities to provide the same functionality.
tracyboehrer commentedon Feb 2, 2021
CredentialsAuthenticator.acquireToken might look something like this:
[-][PORT] [Authentication] updates to support Arlington[/-][+][PORT] [Authentication] Gov: Support temporary service unavailable results.[/+]