Skip to content
Open
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
10 changes: 5 additions & 5 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ This library is distributed via maven central repository. To use this library, i

```
dependencies {
compile 'com.ebay.auth:ebay-oauth-android-client:1.0.1'
implementation 'com.ebay.auth:ebay-oauth-android-client:1.0.1'
}
```


# Application Setup
Before performing OAuth, the library should be initialized with details about your application from eBay developer portal. The library uses
- Client ID. For details see [Getting your OAuth credentials](https://developer.ebay.com/api-docs/static/oauth-credentials.html)
- Redirect Uri. for details see [Getting your Redirect_Uri](https://developer.ebay.com/api-docs/static/oauth-redirect-uri.html)
- Redirect Uri (RuName). for details see [Getting your Redirect_Uri](https://developer.ebay.com/api-docs/static/oauth-redirect-uri.html)
- Url encoded list of scopes. for details see [Specifying OAuth scopes](https://developer.ebay.com/api-docs/static/oauth-scopes.html)

Use these details in `ApiSessionConfiguration.initialize()` as shown below:
Expand All @@ -43,7 +43,7 @@ Use these details in `ApiSessionConfiguration.initialize()` as shown below:
apiEnvironment = ApiEnvironment.PRODUCTION,
apiConfiguration = ApiConfiguration(
<Client ID>,
<Redirect Uri>,
<Redirect Uri / RuName>,
<space separated scopes>
)
)
Expand All @@ -53,7 +53,7 @@ To receive Authorization code, client app must override `OauthRedirectActivity`

```
<activity
android:name=".oauth2.ui.OAuthRedirectActivity"
android:name="com.ebay.api.client.auth.oauth2.ui.OAuthRedirectActivity"
android:exported="true"
tools:node="replace">
<intent-filter>
Expand Down Expand Up @@ -133,7 +133,7 @@ To get the sample working, there are two steps:
2. Open AndroidManifest.xml and edit the redirect_uri with registered redirect_uri from developer portal
```
<activity
android:name=".oauth2.ui.OAuthRedirectActivity"
android:name="com.ebay.api.client.auth.oauth2.ui.OAuthRedirectActivity"
android:exported="true"
tools:node="replace">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,6 @@ class AuthorizationLink {
if (grantType != GrantType.AUTHORIZATION_CODE)
return unSupportedGrantType

// Only allow https redirect uri
if (!redirectUri.startsWith("https"))
return invalidRedirectUri

// verify redirect_uri deep link
if (!deepLinkHelper.verifyDeepLinkInCurrentApp(redirectUri))
return String.format(missingRedirectUriDeepLink, redirectUri)

// verify environment when native deep link
if (environment == ApiEnvironment.SANDBOX &&
deepLinkHelper.verifyEbayDeepLink(Intent(Intent.ACTION_VIEW, Uri.parse(userConsentDeepLink))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ class ApiSessionConfiguration private constructor() {
private val instance: ApiSessionConfiguration = ApiSessionConfiguration()

@Synchronized
fun getInstance(): ApiSessionConfiguration {
@JvmStatic fun getInstance(): ApiSessionConfiguration {
return instance
}

fun initialize(apiEnvironment: ApiEnvironment, apiConfiguration: ApiConfiguration) : ApiSessionConfiguration {
@JvmStatic fun initialize(apiEnvironment: ApiEnvironment, apiConfiguration: ApiConfiguration) : ApiSessionConfiguration {
instance.apiEnvironment = apiEnvironment
instance.apiConfiguration = apiConfiguration
return instance
Expand Down
2 changes: 1 addition & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</activity>

<activity
android:name=".oauth2.ui.OAuthRedirectActivity"
android:name="com.ebay.api.client.auth.oauth2.ui.OAuthRedirectActivity"
android:exported="true"
tools:node="replace">
<!-- <intent-filter>-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MainActivity : AppCompatActivity() {
apiEnvironment = ApiEnvironment.PRODUCTION,
apiConfiguration = ApiConfiguration(
"<app id>",
"<redirect uri>",
"<redirect uri / RuName>",
"scope_1 " + "scope_2"
)
)
Expand Down