mirror of
https://github.com/nextcloud/android.git
synced 2024-11-28 02:17:43 +03:00
DavX5: support login flow
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
954c76b11b
commit
2911a86263
2 changed files with 8 additions and 1 deletions
|
@ -189,7 +189,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
|
|||
private static final String KEY_USERNAME = "USERNAME";
|
||||
private static final String KEY_PASSWORD = "PASSWORD";
|
||||
private static final String KEY_ASYNC_TASK_IN_PROGRESS = "AUTH_IN_PROGRESS";
|
||||
private static final String WEB_LOGIN = "/index.php/login/flow";
|
||||
public static final String WEB_LOGIN = "/index.php/login/flow";
|
||||
public static final String PROTOCOL_SUFFIX = "://";
|
||||
public static final String LOGIN_URL_DATA_KEY_VALUE_SEPARATOR = ":";
|
||||
public static final String HTTPS_PROTOCOL = "https://";
|
||||
|
|
|
@ -62,6 +62,7 @@ import com.nextcloud.client.preferences.AppPreferencesImpl;
|
|||
import com.owncloud.android.BuildConfig;
|
||||
import com.owncloud.android.MainApp;
|
||||
import com.owncloud.android.R;
|
||||
import com.owncloud.android.authentication.AuthenticatorActivity;
|
||||
import com.owncloud.android.authentication.PassCodeManager;
|
||||
import com.owncloud.android.datamodel.ArbitraryDataProvider;
|
||||
import com.owncloud.android.datamodel.ExternalLinksProvider;
|
||||
|
@ -114,6 +115,7 @@ public class SettingsActivity extends PreferenceActivity
|
|||
private static final int ACTION_CONFIRM_PASSCODE = 6;
|
||||
private static final int ACTION_CONFIRM_DEVICE_CREDENTIALS = 7;
|
||||
private static final int ACTION_REQUEST_CODE_DAVDROID_SETUP = 10;
|
||||
private static final int TRUE_VALUE = 1;
|
||||
|
||||
private static final String DAV_PATH = "/remote.php/dav";
|
||||
|
||||
|
@ -750,6 +752,11 @@ public class SettingsActivity extends PreferenceActivity
|
|||
davDroidLoginIntent.putExtra("url", serverBaseUri.toString() + DAV_PATH);
|
||||
}
|
||||
davDroidLoginIntent.putExtra("username", UserAccountManager.getUsername(account));
|
||||
|
||||
davDroidLoginIntent.putExtra("loginFlow", TRUE_VALUE);
|
||||
davDroidLoginIntent.setData(Uri.parse(serverBaseUri.toString() + AuthenticatorActivity.WEB_LOGIN));
|
||||
davDroidLoginIntent.putExtra("davPath", DAV_PATH);
|
||||
|
||||
startActivityForResult(davDroidLoginIntent, ACTION_REQUEST_CODE_DAVDROID_SETUP);
|
||||
} else {
|
||||
// DAVdroid not installed
|
||||
|
|
Loading…
Reference in a new issue