mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
Use proper grant type to get new access token using refresh token
This commit is contained in:
parent
ae8e3ca904
commit
aa717b3e7b
@ -87,13 +87,16 @@ public class OAuth2GetRefreshedAccessTokenOperation extends RemoteOperation {
|
||||
mClientId,
|
||||
mClientSecret
|
||||
);
|
||||
|
||||
OwnCloudCredentials oldCredentials = switchClientCredentials(oauthCredentials);
|
||||
|
||||
client.executeMethod(postMethod);
|
||||
|
||||
switchClientCredentials(oldCredentials);
|
||||
|
||||
String response = postMethod.getResponseBodyAsString();
|
||||
Log_OC.d(TAG, "OAUTH2: raw response from POST TOKEN: " + response);
|
||||
|
||||
if (response != null && response.length() > 0) {
|
||||
JSONObject tokenJson = new JSONObject(response);
|
||||
parseNewAccessTokenResult(tokenJson);
|
||||
|
@ -28,6 +28,7 @@ package com.owncloud.android.lib.common.network.authentication.oauth;
|
||||
|
||||
public enum OAuth2GrantType {
|
||||
AUTHORIZATION_CODE("authorization_code"),
|
||||
REFRESH_TOKEN("refresh_token"),
|
||||
IMPLICIT("implicit"),
|
||||
PASSWORD("password"),
|
||||
CLIENT_CREDENTIAL("client_credentials");
|
||||
|
Loading…
x
Reference in New Issue
Block a user