projects
/
pub
/
Android
/
ownCloud.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
18d4ff2
)
Allow edition of OAuth endpoints for testing; better configuration values
author
David A. Velasco
<dvelasco@solidgear.es>
Fri, 22 Mar 2013 13:50:30 +0000
(14:50 +0100)
committer
David A. Velasco
<dvelasco@solidgear.es>
Fri, 22 Mar 2013 13:50:30 +0000
(14:50 +0100)
res/layout/account_setup.xml
patch
|
blob
|
blame
|
history
res/values/oauth2_configuration.xml
patch
|
blob
|
blame
|
history
src/com/owncloud/android/authentication/AuthenticatorActivity.java
patch
|
blob
|
blame
|
history
diff --git
a/res/layout/account_setup.xml
b/res/layout/account_setup.xml
index
e74ddf7
..
d4d3abe
100644
(file)
--- a/
res/layout/account_setup.xml
+++ b/
res/layout/account_setup.xml
@@
-119,7
+119,6
@@
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
- android:enabled="false"
android:text="@string/oauth2_url_endpoint_auth"
android:singleLine="true"
android:visibility="gone" >
android:text="@string/oauth2_url_endpoint_auth"
android:singleLine="true"
android:visibility="gone" >
@@
-133,7
+132,6
@@
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
- android:enabled="false"
android:text="@string/oauth2_url_endpoint_access"
android:singleLine="true"
android:visibility="gone" >
android:text="@string/oauth2_url_endpoint_access"
android:singleLine="true"
android:visibility="gone" >
diff --git
a/res/values/oauth2_configuration.xml
b/res/values/oauth2_configuration.xml
index
04efddc
..
c3d5c72
100644
(file)
--- a/
res/values/oauth2_configuration.xml
+++ b/
res/values/oauth2_configuration.xml
@@
-1,18
+1,18
@@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- constants that must be respected by the authorization server; if changed, the app must be rebuild -->
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- constants that must be respected by the authorization server; if changed, the app must be rebuild -->
- <string name="oauth2_redirect_scheme">o
auth-mobile-app
</string>
- <string name="oauth2_redirect_uri">o
auth-mobile-app
://callback</string>
+ <string name="oauth2_redirect_scheme">o
wncloud
</string>
+ <string name="oauth2_redirect_uri">o
wncloud
://callback</string>
<!-- values that should be provided by ownCloud server -->
<string name="oauth2_url_endpoint_auth">http://owncloud.tuxed.net/oauth/php-oauth/authorize.php</string>
<string name="oauth2_url_endpoint_access">http://owncloud.tuxed.net/oauth/php-oauth/token.php</string>
<!-- values that should be provided by ownCloud server -->
<string name="oauth2_url_endpoint_auth">http://owncloud.tuxed.net/oauth/php-oauth/authorize.php</string>
<string name="oauth2_url_endpoint_access">http://owncloud.tuxed.net/oauth/php-oauth/token.php</string>
- <string name="oauth2_scope">
grades
</string>
+ <string name="oauth2_scope">
owncloud
</string>
<string name="oauth2_grant_type">authorization_code</string> <!-- the only one supported right now -->
<string name="oauth2_response_type">code</string> <!-- depends on oauth2_grant_type -->
<!-- values that should be agreed between app and authorization server, but can be loaded without rebuilding the app -->
<string name="oauth2_grant_type">authorization_code</string> <!-- the only one supported right now -->
<string name="oauth2_response_type">code</string> <!-- depends on oauth2_grant_type -->
<!-- values that should be agreed between app and authorization server, but can be loaded without rebuilding the app -->
- <string name="oauth2_client_id">
oc-android-test</string>
<!-- preferable that client decides this -->
+ <string name="oauth2_client_id">
com.owncloud.android</string>
<!-- preferable that client decides this -->
<string name="oauth2_client_secret"></string> <!-- preferable that client decides this -->
</resources>
<string name="oauth2_client_secret"></string> <!-- preferable that client decides this -->
</resources>
diff --git
a/src/com/owncloud/android/authentication/AuthenticatorActivity.java
b/src/com/owncloud/android/authentication/AuthenticatorActivity.java
index
9b2dd85
..
44ebf6a
100644
(file)
--- a/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
+++ b/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
@@
-344,7
+344,8
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
getString(R.string.oauth2_redirect_uri), // TODO check - necessary here?
\r
getString(R.string.oauth2_grant_type),
\r
queryParameters);
\r
getString(R.string.oauth2_redirect_uri), // TODO check - necessary here?
\r
getString(R.string.oauth2_grant_type),
\r
queryParameters);
\r
- WebdavClient client = OwnCloudClientUtils.createOwnCloudClient(Uri.parse(getString(R.string.oauth2_url_endpoint_access)), getApplicationContext());
\r
+ //WebdavClient client = OwnCloudClientUtils.createOwnCloudClient(Uri.parse(getString(R.string.oauth2_url_endpoint_access)), getApplicationContext());
\r
+ WebdavClient client = OwnCloudClientUtils.createOwnCloudClient(Uri.parse(mOAuthTokenEndpointText.getText().toString().trim()), getApplicationContext());
\r
operation.execute(client, this, mHandler);
\r
}
\r
\r
operation.execute(client, this, mHandler);
\r
}
\r
\r
@@
-516,7
+517,8
@@
public class AuthenticatorActivity extends AccountAuthenticatorActivity
updateAuthStatus();
\r
\r
// GET AUTHORIZATION request
\r
updateAuthStatus();
\r
\r
// GET AUTHORIZATION request
\r
- Uri uri = Uri.parse(getString(R.string.oauth2_url_endpoint_auth));
\r
+ //Uri uri = Uri.parse(getString(R.string.oauth2_url_endpoint_auth));
\r
+ Uri uri = Uri.parse(mOAuthAuthEndpointText.getText().toString().trim());
\r
Uri.Builder uriBuilder = uri.buildUpon();
\r
uriBuilder.appendQueryParameter(OAuth2Constants.KEY_RESPONSE_TYPE, getString(R.string.oauth2_response_type));
\r
uriBuilder.appendQueryParameter(OAuth2Constants.KEY_REDIRECT_URI, getString(R.string.oauth2_redirect_uri));
\r
Uri.Builder uriBuilder = uri.buildUpon();
\r
uriBuilder.appendQueryParameter(OAuth2Constants.KEY_RESPONSE_TYPE, getString(R.string.oauth2_response_type));
\r
uriBuilder.appendQueryParameter(OAuth2Constants.KEY_REDIRECT_URI, getString(R.string.oauth2_redirect_uri));
\r