I’m trying to get google and twitter login working on a project so I can authenticate with firebase:
void LoginScene::loginWithGoogle() {
this->logMessage("Signing in with Google ...");
Credential google_credential =
GoogleAuthProvider::GetCredential("");
Auth* auth = Auth::GetAuth(firebase::App::GetInstance());
_google_sign_in_future = auth->SignInWithCredential(google_credential);
}
void LoginScene::loginWithTwitter() {
this->logMessage("Signing in with Twitter ...");
Credential twitter_credential =
FacebookAuthProvider::GetCredential("");
Auth* auth = Auth::GetAuth(firebase::App::GetInstance());
_twitter_sign_in_future = auth->SignInWithCredential(twitter_credential);
}
This will NOT work because I don’t have the value to put into GetCredential when requesting a credential from the Auth providers. In the notes Firebase suggest running Java code:
https://firebase.google.com/docs/auth/cpp/twitter-login
https://firebase.google.com/docs/auth/cpp/google-signin
“Authenticate with Firebase
Follow Twitter sign-in instructions for Android and iOS to get an OAuth access token and an OAuth secret.
After a user successfully signs in, exchange the token and secret for a Firebase credential, and authenticate with Firebase using the Firebase credential:
…”
“Authenticate with Firebase
Follow instructions for Android and iOS to get an ID token for the Google sign in.
After a user successfully signs in, exchange the ID token for a Firebase credential, and authenticate with Firebase using the Firebase credential:
…”
But it’s at this point where I get really stuck? For example, that might be possible if I knew how to get back to Java…but what about iOS? If anyone can help/advise it would be great. I’m out of my depth with this one.
Thanks,
Katie