Skip to content

adding in changes so that this will work with api 30 #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ group = GROUP
archivesBaseName = POM_ARTIFACT_ID

android {
compileSdkVersion 28
compileSdkVersion 30

defaultConfig {
versionCode 1
versionName VERSION_NAME
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 30
}

// Related to https://github.com/scribejava/scribejava/issues/480
Expand Down Expand Up @@ -90,18 +90,18 @@ ext {
}

dependencies {
api "androidx.appcompat:appcompat:1.0.2"
api 'com.codepath.libraries:asynchttpclient:0.0.8'
api "androidx.appcompat:appcompat:1.3.0"
api 'com.codepath.libraries:asynchttpclient:2.1.1'
api 'com.github.scribejava:scribejava-apis:4.1.1'
api 'com.github.scribejava:scribejava-httpclient-okhttp:4.1.1'
implementation 'se.akerfeldt:okhttp-signpost:1.1.0'
implementation 'oauth.signpost:signpost-core:1.2.1.2'
implementation 'com.facebook.stetho:stetho:1.5.1'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.1'
implementation "com.squareup.okhttp3:logging-interceptor:4.1.0"
implementation "com.squareup.okhttp3:logging-interceptor:4.7.2"

}

/*task jar(type: Jar) {
task jar(type: Jar) {
from android.sourceSets.main.java.srcDirs
}*/
}
10 changes: 9 additions & 1 deletion library/src/main/java/com/codepath/oauth/OAuthTokenClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,20 @@ public OAuthTokenClient(BaseApi apiInstance, String consumerKey, String consumer
this.apiInstance = apiInstance;
this.handler = handler;
if (callbackUrl == null) { callbackUrl = OAuthConstants.OUT_OF_BAND; };
this.service = new ServiceBuilder()
if(scope == null) {
this.service = new ServiceBuilder()
.apiKey(consumerKey)
.apiSecret(consumerSecret).callback(callbackUrl)
.httpClientConfig(OkHttpHttpClientConfig.defaultConfig())
.build(apiInstance);
} else {
this.service = new ServiceBuilder()
.apiKey(consumerKey)
.apiSecret(consumerSecret).callback(callbackUrl)
.httpClientConfig(OkHttpHttpClientConfig.defaultConfig())
.scope(scope) // OAuth2 requires scope
.build(apiInstance);
}
}

// Get a request token and the authorization url
Expand Down