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

Vimeo sdk is not working on android #613

Open
nitish1227 opened this issue Jun 1, 2023 · 0 comments
Open

Vimeo sdk is not working on android #613

nitish1227 opened this issue Jun 1, 2023 · 0 comments

Comments

@nitish1227
Copy link

Summary

Vimeo sdk is not working on android. I am using github code in android. but log-in functionality is not working in demo.

Reproduction Steps

authenticate method not working. I have added client and secret key and I have added CODE_GRANT_REDIRECT_URL
I am using CODE_GRANT_REDIRECT_URL: vimeoa98a01c93be150d26c2739b713429580bc0d47f2://auth. and I have added in manifeast

private fun authenticate(redirectUri: Uri?, authenticator: Authenticator) {
if (redirectUri != null) {
// Optional, but for security purposes, we can verify that the code we specified is returned to us.
val requestCode = redirectUri.getQueryParameter("state")
require(requestCode == REQUEST_CODE)

        // Log in using the code grant URI provided to us by the redirect.
        authenticator.authenticateWithCodeGrant(redirectUri.toString(), vimeoCallback(
            onSuccess = {
                toast("Successfully logged in.")
                binding.loginStatus.text = authenticator.currentAccount.asLoginStatus()
            },
            onError = { toast("Unable to log in.") }
        ))
    } else {
        // Obtain client credentials which can be used to make logged out requests.
        // Obtaining client credentials is technically optional and basic auth can be used instead. However, using
        // basic auth can result in your client secret being leaked, so it is better to use client credentials. If
        // client credentials are not obtained or this request fails, the VimeoApiClient will fall back to basic
        // authentication.
        authenticator.authenticateWithClientCredentials(vimeoCallback(
            onSuccess = {
                toast("Obtained client credentials.")
                binding.loginStatus.text = authenticator.currentAccount.asLoginStatus()
            },
            onError = { toast("Couldn't obtain client credentials.") }
        ))
    }
}

Expected Behavior

I have received error:
Api(reason=ApiError(developerMessage=Code grant authentication error, errorMessage=null, errorCode=null, invalidParameters=[InvalidParameter(field=code, errorCode=2204, error=null, developerMessage=URI was invalid or did not contain a 'code' parameter)], link=null), httpStatusCode=-1)

Actual Behavior

What currently happens as a result of the reproduction steps?

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