I am using Firebase in my Google Chrome App. Since Chrome Apps do not have a domain and a callback url, I need to authorize with the Token and not the popup.
I am having problems getting authWithOAuthToken to work, even in the browser.
In this code example the first call to authWithOAuthPopup works, I get the popupData which includes github account info and my token. The issue is that the second call to authWithOAuthToken is not working. I get an error
db.authWithOAuthPopup("github", function(error, popupData) {
if (error) {
console.log("Login Failed!", error);
} else {
console.log("Authenticated successfully with payload: ", popupData);
console.log("Now attempting to Authorize with Token...");
db.authWithOAuthToken("github", popupData.token, function (err, tokenData) {
if (err) {
console.log("Login Failed!", err);
} else {
console.log("Authenticated successfully", tokenData);
}
});
}
});
My console output shows the first call working, and the second call failing:
bundle.js:20498 Authenticated successfully with payload: Object
Now attempting to Authorize with Token...
Login Failed! Error: Invalid authentication credentials provided.(…)
How can I get authWithOAuthToken to work?