Error Response: 'Failed to verify code verifier' from server

I use following approach for social sign in.

    WebAuthProvider.init(auth0)
            .withScheme("com.myapp.app")
            .withAudience("http://goo.gl")
            .withParameters(map)
            .withConnection("google-oauth2")
            .withScope("openid profile email offline_access")
            .start(activity, webCallback);

After sign in i get code in my activity by doing following.

    if (getIntent().getData() != null) {
       String code= getIntent().getData().getQueryParameter("code");

}

Till now everything is good, now i need code_verifier. I am using following approach to get code_verifier.

    SecureRandom sr = new SecureRandom();
    byte[] code = new byte[32];
    sr.nextBytes(code);
    String verifier = Base64.encodeToString(code, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
    return verifier;

but when i pass the code with code_verifier, i get following response from server.

code=400, message=Failed to verify code verifier,

Please guide me how to pass correct code_verifier

Hey there!

Sorry for such a delayed response! We’re doing our best in providing you with the best developer support experience out there but sometimes our bandwidth is just not enough for all the questions coming in. Sorry for the inconvenience!

Can you let us know if you still require further assistance from us?