Source:
private void validateAcquireTokenRequest(final AuthenticationRequest authenticationRequest) throws AuthenticationException { final URL authorityUrl = StringExtensions.getUrl(authenticationRequest.getAuthority()); if (authorityUrl == null) { throw new AuthenticationException( ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL); } if (mTokenCacheAccessor != null) { mTokenCacheAccessor.setAuthRequest(authenticationRequest); } Telemetry.getInstance().startEvent(authenticationRequest.getTelemetryRequestId(), EventStrings.AUTHORITY_VALIDATION_EVENT); APIEvent apiEvent = new APIEvent(EventStrings.AUTHORITY_VALIDATION_EVENT); if (mAuthContext.getValidateAuthority()) { try { validateAuthority(authorityUrl); apiEvent.setValidationStatus(EventStrings.AUTHORITY_VALIDATION_SUCCESS); } catch (AuthenticationException ex) { apiEvent.setValidationStatus(EventStrings.AUTHORITY_VALIDATION_FAILURE); throw ex; } finally { Telemetry.getInstance().stopEvent(authenticationRequest.getTelemetryRequestId(), apiEvent, EventStrings.AUTHORITY_VALIDATION_EVENT); } } else { apiEvent.setValidationStatus(EventStrings.AUTHORITY_VALIDATION_NOT_DONE); Telemetry.getInstance().stopEvent(authenticationRequest.getTelemetryRequestId(), apiEvent, EventStrings.AUTHORITY_VALIDATION_EVENT); } if (canSwitchToBroker(authenticationRequest) && !authenticationRequest.isSilent()) { verifyBrokerRedirectUri(authenticationRequest); } }

Target:
private void validateAcquireTokenRequest(final AuthenticationRequest authenticationRequest) throws AuthenticationException { final URL authorityUrl = StringExtensions.getUrl(authenticationRequest.getAuthority()); if (authorityUrl == null) { throw new AuthenticationException( ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL); } Telemetry.getInstance().startEvent(authenticationRequest.getTelemetryRequestId(), EventStrings.AUTHORITY_VALIDATION_EVENT); APIEvent apiEvent = new APIEvent(EventStrings.AUTHORITY_VALIDATION_EVENT); apiEvent.setCorrelationId(authenticationRequest.getCorrelationId().toString()); apiEvent.setRequestId(authenticationRequest.getTelemetryRequestId()); if (mAuthContext.getValidateAuthority()) { try { validateAuthority(authorityUrl, authenticationRequest.getCorrelationId()); apiEvent.setValidationStatus(EventStrings.AUTHORITY_VALIDATION_SUCCESS); } catch (AuthenticationException ex) { apiEvent.setValidationStatus(EventStrings.AUTHORITY_VALIDATION_FAILURE); throw ex; } finally { Telemetry.getInstance().stopEvent(authenticationRequest.getTelemetryRequestId(), apiEvent, EventStrings.AUTHORITY_VALIDATION_EVENT); } } else { apiEvent.setValidationStatus(EventStrings.AUTHORITY_VALIDATION_NOT_DONE); Telemetry.getInstance().stopEvent(authenticationRequest.getTelemetryRequestId(), apiEvent, EventStrings.AUTHORITY_VALIDATION_EVENT); } final BrokerProxy.SwitchToBroker canSwitchToBrokerFlag = mBrokerProxy.canSwitchToBroker(); if (canSwitchToBrokerFlag != BrokerProxy.SwitchToBroker.CANNOT_SWITCH_TO_BROKER && mBrokerProxy.verifyUser(authenticationRequest.getLoginHint(), authenticationRequest.getUserId()) && !authenticationRequest.isSilent()) { if (canSwitchToBrokerFlag == BrokerProxy.SwitchToBroker.NEED_PERMISSIONS_TO_SWITCH_TO_BROKER) { throw new UsageAuthenticationException( ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING, "Broker related permissions are missing for GET_ACCOUNTS."); } verifyBrokerRedirectUri(authenticationRequest); } }