Source:
<code>private AuthenticationException getAuthenticationExceptionForResult(final String oauth2ErrorCode, final String oauth2ErrorDescription, final Bundle bundleResult) { <START> final String message = "Received error from broker, errorCode: " + oauth2ErrorCode + "; ErrorDescription: " + oauth2ErrorDescription; <END> final Serializable responseBody = bundleResult.getSerializable(AuthenticationConstants.OAuth2.HTTP_RESPONSE_BODY); if (null != responseBody && responseBody instanceof HashMap) { final HashMap<String, String> responseMap = (HashMap<String, String>) responseBody; final String error = responseMap.get(AuthenticationConstants.OAuth2.ERROR); final String suberror = responseMap.get(AuthenticationConstants.OAuth2.SUBERROR); if (AuthenticationConstants.OAuth2ErrorCode.UNAUTHORIZED_CLIENT.compareTo(error) == 0 && AuthenticationConstants.OAuth2ErrorCode.PROTECTION_POLICY_REQUIRED.compareTo(suberror) == 0) { final String accountUpn = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_NAME); final String accountUserId = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_USERINFO_USERID); final String tenantId = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_USERINFO_TENANTID); final String authorityUrl = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_AUTHORITY); AuthenticationException exception = new IntuneAppProtectionPolicyRequiredException( message, accountUpn, accountUserId, tenantId, authorityUrl); return exception; } } return new AuthenticationException(ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED, message); }</code><technical_language>nit: string.format instead of concatenation</technical_language>

Target:
private AuthenticationException getAuthenticationExceptionForResult(final String oauth2ErrorCode, final String oauth2ErrorDescription, final Bundle bundleResult) { final String message = String.format("Received error from broker, errorCode: %s; ErrorDescription: %s", oauth2ErrorCode, oauth2ErrorDescription); final Serializable responseBody = bundleResult.getSerializable(AuthenticationConstants.OAuth2.HTTP_RESPONSE_BODY); if (null != responseBody && responseBody instanceof HashMap) { final HashMap<String, String> responseMap = (HashMap<String, String>) responseBody; final String error = responseMap.get(AuthenticationConstants.OAuth2.ERROR); final String suberror = responseMap.get(AuthenticationConstants.OAuth2.SUBERROR); if (!StringExtensions.isNullOrBlank(error) && !StringExtensions.isNullOrBlank(suberror) && AuthenticationConstants.OAuth2ErrorCode.UNAUTHORIZED_CLIENT.compareTo(error) == 0 && AuthenticationConstants.OAuth2ErrorCode.PROTECTION_POLICY_REQUIRED.compareTo(suberror) == 0) { final String accountUpn = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_NAME); final String accountUserId = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_USERINFO_USERID); final String tenantId = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_USERINFO_TENANTID); final String authorityUrl = bundleResult.getString(AuthenticationConstants.Broker.ACCOUNT_AUTHORITY); AuthenticationException exception = new IntuneAppProtectionPolicyRequiredException( message, accountUpn, accountUserId, tenantId, authorityUrl); return exception; } } return new AuthenticationException(ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED, message); }