mirror of
https://github.com/nextcloud/android.git
synced 2024-10-22 20:16:02 +03:00
OC-1079: Use isIdPRedirection
This commit is contained in:
parent
da77406209
commit
4047c62527
4 changed files with 10 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()))
|
||||
)
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue