10
10
* Helper class for integrating with {@link AuthActivity}
11
11
*/
12
12
public class Auth {
13
-
13
+
14
+
15
+ /**
16
+ * @see Auth#startOAuth2Authentication(Context, String, String, String[], String, String)
17
+ */
14
18
public static void startOAuth2Authentication (Context context ,String appKey ) {
15
19
startOAuth2Authentication (context ,appKey ,null ,null ,null );
16
20
}
17
21
22
+ /**
23
+ * @see Auth#startOAuth2Authentication(Context, String, String, String[], String, String)
24
+ */
25
+ public static void startOAuth2Authentication (Context context ,String appKey ,String desiredUid ,
26
+ String []alreadyAuthedUids ,String sessionId ) {
27
+ startOAuth2Authentication (context ,appKey ,desiredUid ,alreadyAuthedUids ,sessionId ,"www.dropbox.com" );
28
+ }
29
+
18
30
/**
19
31
* Starts the Dropbox authentication process by launching an external app
20
32
* (either the Dropbox app if available or a web browser) where the user
@@ -41,12 +53,17 @@ public static void startOAuth2Authentication(Context context, String appKey) {
41
53
* user accounts. (note that user may still authorize the accounts).
42
54
* @param sessionId The SESSION_ID Extra on an OpenWith intent. null if dAuth
43
55
* is being launched outside of OpenWith flow
56
+ * @param webHost Server host used for oauth
44
57
* @throws IllegalStateException if you have not correctly set up the AuthActivity in your
45
58
* manifest, meaning that the Dropbox app will
46
59
* not be able to redirect back to your app after auth.
47
60
*/
48
- public static void startOAuth2Authentication (Context context ,String appKey ,String desiredUid ,
49
- String []alreadyAuthedUids ,String sessionId ) {
61
+ public static void startOAuth2Authentication (Context context ,
62
+ String appKey ,
63
+ String desiredUid ,
64
+ String []alreadyAuthedUids ,
65
+ String sessionId ,
66
+ String webHost ) {
50
67
if (!AuthActivity .checkAppBeforeAuth (context ,appKey ,true /*alertUser*/ )) {
51
68
return ;
52
69
}
@@ -57,9 +74,8 @@ public static void startOAuth2Authentication(Context context, String appKey, Str
57
74
58
75
// Start Dropbox auth activity.
59
76
String apiType ="1" ;
60
- String webHost ="www.dropbox.com" ;
61
77
Intent intent =AuthActivity .makeIntent (
62
- context ,appKey ,desiredUid ,alreadyAuthedUids ,sessionId ,webHost ,apiType
78
+ context ,appKey ,desiredUid ,alreadyAuthedUids ,sessionId ,webHost ,apiType
63
79
);
64
80
if (!(context instanceof Activity )) {
65
81
// If starting the intent outside of an Activity, must include