Use redirect_uri to get access token from OneDrive
This commit is contained in:
parent
559455aac6
commit
24651e9095
@ -28,11 +28,11 @@ git submodule init && git submodule update // (not necessary if cloned using --r
|
||||
./gradlew assembleApkstoreDebug
|
||||
```
|
||||
|
||||
Before connecting to Onedrive or Dropbox you have to provide valid API keys using environment variables:
|
||||
Before connecting to OneDrive or Dropbox you have to provide valid API keys using environment variables:
|
||||
For build type
|
||||
|
||||
* **release**: `ONEDRIVE_API_KEY` or `DROPBOX_API_KEY`.
|
||||
* **debug**: `ONEDRIVE_API_KEY_DEBUG` or `DROPBOX_API_KEY_DEBUG`.
|
||||
* **release**: `DROPBOX_API_KEY` or `ONEDRIVE_API_KEY` and `ONEDRIVE_API_REDIRCT_URI`
|
||||
* **debug**: `DROPBOX_API_KEY_DEBUG` or `ONEDRIVE_API_KEY_DEBUG` and `ONEDRIVE_API_REDIRCT_URI_DEBUG`
|
||||
|
||||
## Contributing to Cryptomator for Android
|
||||
|
||||
|
@ -33,10 +33,12 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
buildConfigField "String", "ONEDRIVE_API_KEY", "\"" + getApiKey('ONEDRIVE_API_KEY') + "\""
|
||||
buildConfigField "String", "ONEDRIVE_API_REDIRCT_URI", "\"" + getApiKey('ONEDRIVE_API_REDIRCT_URI') + "\""
|
||||
}
|
||||
|
||||
debug {
|
||||
buildConfigField "String", "ONEDRIVE_API_KEY", "\"" + getApiKey('ONEDRIVE_API_KEY_DEBUG') + "\""
|
||||
buildConfigField "String", "ONEDRIVE_API_REDIRCT_URI", "\"" + getApiKey('ONEDRIVE_API_REDIRCT_URI_DEBUG') + "\""
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,8 @@ import android.net.Uri;
|
||||
|
||||
import com.microsoft.services.msa.OAuthConfig;
|
||||
|
||||
import org.cryptomator.data.BuildConfig;
|
||||
|
||||
class MicrosoftOAuth2Endpoint implements OAuthConfig {
|
||||
/**
|
||||
* The current instance of this class
|
||||
@ -12,7 +14,7 @@ class MicrosoftOAuth2Endpoint implements OAuthConfig {
|
||||
|
||||
/**
|
||||
* The current instance of this class
|
||||
*
|
||||
*
|
||||
* @return The instance
|
||||
*/
|
||||
static MicrosoftOAuth2Endpoint getInstance() {
|
||||
@ -26,7 +28,7 @@ class MicrosoftOAuth2Endpoint implements OAuthConfig {
|
||||
|
||||
@Override
|
||||
public Uri getDesktopUri() {
|
||||
return Uri.parse("urn:ietf:wg:oauth:2.0:oob");
|
||||
return Uri.parse(BuildConfig.ONEDRIVE_API_REDIRCT_URI);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user