Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita6ed455

Browse files
author
Jake Scott
authored
Update Auth.java
Allows the webhost used for oauth to be specified
1 parent1b6cde9 commita6ed455

File tree

1 file changed

+21
-5
lines changed
  • src/main/java/com/dropbox/core/android

1 file changed

+21
-5
lines changed

‎src/main/java/com/dropbox/core/android/Auth.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,23 @@
1010
* Helper class for integrating with {@link AuthActivity}
1111
*/
1212
publicclassAuth {
13-
13+
14+
15+
/**
16+
* @see Auth#startOAuth2Authentication(Context, String, String, String[], String, String)
17+
*/
1418
publicstaticvoidstartOAuth2Authentication(Contextcontext,StringappKey) {
1519
startOAuth2Authentication(context,appKey,null,null,null);
1620
}
1721

22+
/**
23+
* @see Auth#startOAuth2Authentication(Context, String, String, String[], String, String)
24+
*/
25+
publicstaticvoidstartOAuth2Authentication(Contextcontext,StringappKey,StringdesiredUid,
26+
String[]alreadyAuthedUids,StringsessionId) {
27+
startOAuth2Authentication(context,appKey,desiredUid,alreadyAuthedUids,sessionId,"www.dropbox.com");
28+
}
29+
1830
/**
1931
* Starts the Dropbox authentication process by launching an external app
2032
* (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) {
4153
* user accounts. (note that user may still authorize the accounts).
4254
* @param sessionId The SESSION_ID Extra on an OpenWith intent. null if dAuth
4355
* is being launched outside of OpenWith flow
56+
* @param webHost Server host used for oauth
4457
* @throws IllegalStateException if you have not correctly set up the AuthActivity in your
4558
* manifest, meaning that the Dropbox app will
4659
* not be able to redirect back to your app after auth.
4760
*/
48-
publicstaticvoidstartOAuth2Authentication(Contextcontext,StringappKey,StringdesiredUid,
49-
String[]alreadyAuthedUids,StringsessionId) {
61+
publicstaticvoidstartOAuth2Authentication(Contextcontext,
62+
StringappKey,
63+
StringdesiredUid,
64+
String[]alreadyAuthedUids,
65+
StringsessionId,
66+
StringwebHost) {
5067
if (!AuthActivity.checkAppBeforeAuth(context,appKey,true/*alertUser*/)) {
5168
return;
5269
}
@@ -57,9 +74,8 @@ public static void startOAuth2Authentication(Context context, String appKey, Str
5774

5875
// Start Dropbox auth activity.
5976
StringapiType ="1";
60-
StringwebHost ="www.dropbox.com";
6177
Intentintent =AuthActivity.makeIntent(
62-
context,appKey,desiredUid,alreadyAuthedUids,sessionId,webHost,apiType
78+
context,appKey,desiredUid,alreadyAuthedUids,sessionId,webHost,apiType
6379
);
6480
if (!(contextinstanceofActivity)) {
6581
// If starting the intent outside of an Activity, must include

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp