Skip to content

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

@paperkiteSonny

Description

@paperkiteSonny

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions