1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-08 16:36:13 +00:00

Redirections to the Identity Provider (IdP) are translated into ResultCode.UNAUTHORIZED

This commit is contained in:
David A. Velasco 2016-03-14 09:25:47 +01:00
parent d36fa0b38b
commit 78b9aa6247
2 changed files with 5 additions and 1 deletions

View File

@ -307,7 +307,8 @@ public abstract class RemoteOperation implements Runnable {
* to trigger authentication update */
if (mCallerActivity != null && mAccount != null && mContext != null &&
!result.isSuccess() &&
(result.getCode() == ResultCode.UNAUTHORIZED || result.isIdPRedirection())) {
ResultCode.UNAUTHORIZED.equals(result.getCode())
) {
/// possible fail due to lack of authorization
// in an operation performed in foreground
OwnCloudCredentials cred = mClient.getCredentials();

View File

@ -183,6 +183,9 @@ public class RemoteOperationResult implements Serializable {
}
}
}
if (isIdPRedirection()) {
mCode = ResultCode.UNAUTHORIZED; // overrides default ResultCode.UNKNOWN
}
}
public RemoteOperationResult(boolean success, String bodyResponse, int httpCode) {