Closed
Description
When user cancels the auth flow, request (holding callback class) is not getting removed from the static mDelegateMap, leading to leak in the callback class. Below code gets executed on auth cancel scenario.
// User cancelled the flow by clicking back button or
// activating another activity
Logger.v(TAG, "User cancelled the flow RequestId:" + requestId
+ correlationInfo);
waitingRequestOnError(waitingRequest, requestId, new AuthenticationCancelError(
"User cancelled the flow RequestId:" + requestId + correlationInfo));
private void waitingRequestOnError(final AuthenticationRequestState waitingRequest,
int requestId, AuthenticationException exc) {
if (waitingRequest != null && waitingRequest.mDelagete != null) {
Logger.v(TAG, "Sending error to callback"
+ getCorrelationInfoFromWaitingRequest(waitingRequest));
waitingRequest.mDelagete.onError(exc);
}
if (exc != null && exc.getCode() != ADALError.AUTH_FAILED_CANCELLED) {
removeWaitingRequest(requestId);
}
}
As you can see, In case of cancel, waiting request is not getting removed.
Metadata
Metadata
Assignees
Labels
No labels