uber / uber/rides-android-sdk

Use the function - redirect back to App, cannot get the TokenID

Open
#191 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
293
Forks
132
PR merge metrics
No merged PRs in 30d

Description

Github issues are for bug reports. If this is a question around usage or understanding please use
Stack Overflow. https://stackoverflow.com/questions/tagged/uber-api

Library version: 0.10.x

When moving back(Redirect) to the app, get the error "error: AuthenticationError" (INVALID_RESPONSE).
Please help to check the reason why cannot get the token-Id. Thanks

return  SessionConfiguration.Builder()
    .setClientId("xxxxxx")   // if needed, I can pass it privately.
    .setRedirectUri("${context.applicationInfo.packageName}.uberauth://redirect")
    .setEnvironment(SessionConfiguration.Environment.SANDBOX)
    .setScopes(
            arrayListOf(
                        Scope.PROFILE
            )
    )
    .build()

}

    binding.uberButtonWhite.setOnClickListener {
        val accessTokenStorage = AccessTokenManager(this)
        loginManager = LoginManager(accessTokenStorage, object: LoginCallback{
            override fun onLoginCancel() {
                Timber.d("onLoginCancel")
            }
            **override fun onLoginError(error: AuthenticationError) {
                Timber.d("$error")
            }**
            override fun onLoginSuccess(accessToken: AccessToken) {
                Timber.d("$accessToken")
            }
            override fun onAuthorizationCodeReceived(authorizationCode: String) {
                Timber.d(authorizationCode)
            }
        }, UberManager.getConfig(this))
        loginManager?.login(this)
    }
}

Expected Behavior:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the redirect flow from SessionConfiguration.Builder through LoginManager.login using the provided sandbox configuration and callback. Inspect the AuthenticationError INVALID_RESPONSE result and the redirect/token handling; done means the app returns from redirect and receives a valid token ID.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.