Skip to content
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

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

Open
paperkiteSonny opened this issue Feb 9, 2023 · 0 comments
Open

Comments

@paperkiteSonny
Copy link

paperkiteSonny commented Feb 9, 2023

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant