OC-1079: Use isIdPRedirection

This commit is contained in:
masensio 2013-08-27 12:32:52 +02:00
parent da77406209
commit 4047c62527
4 changed files with 10 additions and 5 deletions

View file

@ -465,7 +465,8 @@ public class FileDownloader extends Service implements OnDatatransferProgressLis
Notification finalNotification = new Notification(R.drawable.icon, getString(tickerId), System.currentTimeMillis());
finalNotification.flags |= Notification.FLAG_AUTO_CANCEL;
boolean needsToUpdateCredentials = (downloadResult.getCode() == ResultCode.UNAUTHORIZED ||
(downloadResult.isTemporalRedirection() && downloadResult.isIdPRedirection()
// (downloadResult.isTemporalRedirection() && downloadResult.isIdPRedirection()
(downloadResult.isIdPRedirection()
&& AccountAuthenticator.AUTH_TOKEN_TYPE_SAML_WEB_SSO_SESSION_COOKIE.equals(mDownloadClient.getAuthTokenType())));
if (needsToUpdateCredentials) {
// let the user update credentials with one click

View file

@ -794,7 +794,8 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
String content = null;
boolean needsToUpdateCredentials = (uploadResult.getCode() == ResultCode.UNAUTHORIZED ||
(uploadResult.isTemporalRedirection() && uploadResult.isIdPRedirection() &&
//(uploadResult.isTemporalRedirection() && uploadResult.isIdPRedirection() &&
(uploadResult.isIdPRedirection() &&
AccountAuthenticator.AUTH_TOKEN_TYPE_SAML_WEB_SSO_SESSION_COOKIE.equals(mUploadClient.getAuthTokenType())));
if (needsToUpdateCredentials) {
// let the user update credentials with one click

View file

@ -243,7 +243,8 @@ public abstract class RemoteOperation implements Runnable {
repeat = false;
if (mCallerActivity != null && mAccount != null && mContext != null && !result.isSuccess() &&
(result.getCode() == ResultCode.UNAUTHORIZED || (result.isTemporalRedirection() && result.isIdPRedirection()))) {
// (result.getCode() == ResultCode.UNAUTHORIZED || (result.isTemporalRedirection() && result.isIdPRedirection()))) {
(result.getCode() == ResultCode.UNAUTHORIZED || result.isIdPRedirection())) {
/// possible fail due to lack of authorization in an operation performed in foreground
Credentials cred = mClient.getCredentials();
String ssoSessionCookie = mClient.getSsoSessionCookie();

View file

@ -225,7 +225,8 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
} else {
if (result.getCode() == RemoteOperationResult.ResultCode.UNAUTHORIZED ||
(result.isTemporalRedirection() && result.isIdPRedirection() &&
// (result.isTemporalRedirection() && result.isIdPRedirection() &&
( result.isIdPRedirection() &&
AccountAuthenticator.AUTH_TOKEN_TYPE_SAML_WEB_SSO_SESSION_COOKIE.equals(getClient().getAuthTokenType()))) {
mSyncResult.stats.numAuthExceptions++;
@ -309,7 +310,8 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
notification.flags |= Notification.FLAG_AUTO_CANCEL;
boolean needsToUpdateCredentials = (mLastFailedResult != null &&
( mLastFailedResult.getCode() == ResultCode.UNAUTHORIZED ||
(mLastFailedResult.isTemporalRedirection() && mLastFailedResult.isIdPRedirection() &&
// (mLastFailedResult.isTemporalRedirection() && mLastFailedResult.isIdPRedirection() &&
( mLastFailedResult.isIdPRedirection() &&
AccountAuthenticator.AUTH_TOKEN_TYPE_SAML_WEB_SSO_SESSION_COOKIE.equals(getClient().getAuthTokenType()))
)
);