I'm trying to implement sign in with google, and to an extent I have. I've been using this plugin https://www.assetstore.unity3d.com/en/#!/content/94517 to get the authentication info for google including the server auth code and sending that to playfab. The plugin's google login works fine and when I send it to playfab it usually works the first time as well. But after attempting it one more time the playfab link/login fails consistently with the error invalid_grant: code already redeemed.
I start by generating an account with the android device id. When the user clicks the login button my flow is the following : Get Server Auth Code->Attempt to link google account->Log in with google account if successful or if another account linked to that google account exists->unlink android device if link was successful.
I also make sure to save the server auth code when the user launches the app again. Though I doubt this is the issue because I did try not saving it, and I still ended up with the same issues. The Server Auth Code does appear to be a different string each time as well.