FIRAuthInternalErrorDomain when trying to login with Google - firebase

I've setup Google login in my Firebase app (I'm using the new Firebase console), but each time I try with Google, I get the following error:
#<NSError:0x11f0625a0, description="An internal error has occurred, print and inspect the error details for more information.", code=17999, domain="FIRAuthErrorDomain", userInfo={"NSUnderlyingError"=>#<NSError:0x122278130, description="The operation couldn’t be completed. (FIRAuthInternalErrorDomain error 3.)", code=3, domain="FIRAuthInternalErrorDomain", userInfo={"FIRAuthErrorUserInfoDeserializedResponseKey"=>{"message"=>"", "errors"=>[{"reason"=>"invalid", "message"=>"", "domain"=>"global"}], "code"=>400}}>, "error_name"=>"ERROR_INTERNAL_ERROR", "NSLocalizedDescription"=>"An internal error has occurred, print and inspect the error details for more information."}>
I don't really know where yo go from here, since there's no message in the message field. Any guesses on what this could be?
I've recently migrated to the new version of Firebase btw. I'm using the new SDK in my iOS app. Furthermore, I setup Google authentication a week before I migrated. I'm not sure if any keys have been overwritten in the migration. How do I check if I have the right keys in my console vs my GoogleService plist file?

Related

How to use the resource_owner grant within Microsoft365R

I'm trying to implement an unattended script accessing files within OneDrive using Microsoft365R.
I've setup everything like in the docs using the default app registration.
The interactive flow with auth_type="device_code" works without issues:
odb <- Microsoft365R::get_business_onedrive(auth_type="device_code")
But when trying auth_type="resource_owner" like shown in the docs here, I get the following error:
odb <- Microsoft365R::get_business_onedrive(tenant=tenant, app=app, username=user, password=getPass(), auth_type="resource_owner")
Error in process_aad_response(res) :
Bad Request (HTTP 400). Failed to obtain Azure Active Directory token. Message:
AADSTS50126: Error validating credentials due to invalid username or password.
My guess is, that the default app is missing some privileges to use the "resource_owner" flow.
Can someone point me to the right direction on how to get the resource_owner flow working?
(Using Service Principles is not a solution for my setup, but I did also try it with a dedicated service account and it was not working either)

Firebase Login error

1) Now I am facing issue with firebase. After one month, I am trying to deploy new code using command “firebase deploy –only function” in command prompt. I got below error
Error: Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth
For CI servers and headless environments, generate a new token with firebase login:ci
Then I have executed “firebase login –reauth” , I got below comments
“? Allow Firebase to collect anonymous CLI usage and error reporting information? Yes
Visit this URL on any device to log in:
https://accounts.google.com/o/oauth2/auth?client_id=563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplat
formprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=430670875&redirect_uri=http%3A%2F%2Floca
lhost%3A9005
Waiting for authentication...”
It opened in new browser. In their , i have selected my google account and pressed “allow” button. I am getting firebase login failure error in browser.
“Oops!
Firebase CLI Login Failed
The Firebase CLI login request was rejected or an error occurred. Please run firebase login again or contact support if you continue to have difficulty logging in
“
After this I have executed command “ firebase login” in command prompt, I got response as “Already logged in as thirus.selvam.2007#gmail.com”. Once again I have tried “firebase deploy –only functions” , I got same error.
I didn’t get any errors on last month, How to resolve this error?
2) After these error, i have planned to create another test project using Google cloud please find the response in the response in command prompt
C:\app\Google Home\test\TestingSetup>gcloud init
Welcome! This command will take you through the configuration of gcloud.
Settings from your current configuration [testsetup] are:
core:
disable_usage_reporting: 'True'
Pick configuration to use:
[1] Re-initialize this configuration [testsetup] with new settings
[2] Create a new configuration
[24] Switch to and re-initialize existing configuration: [samplets6]
[25] Switch to and re-initialize existing configuration: [three-door-3456]
Please enter your numeric choice: 2
Enter configuration name. Names start with a lower case letter and
contain only lower case letters a-z, digits 0-9, and hyphens '-': testingsetup
Your current configuration has been set to: [testingsetup]
You can skip diagnostics next time by using the following flag:
gcloud init --skip-diagnostics
Network diagnostic detects and fixes local network connection issues.
Checking network connection...\

Invalid token because of wrong audience?

I just made a firebase project, installed the pods and got the googleplist in, configured it in the app delegate, and set it up exactly like I have other projects.
For my pods, I've got exactly what I have in my main other project :
pod 'Firebase/Core’
pod ‘Firebase/Auth’
pod ‘Firebase/Database’
When I run this code :
let ref = FIRDatabase.database().reference()
ref.setValue("hello")
I get an error that pops up like 50 times that says :
MyProjectName[209384092:9028304928034randomnumbers] [FirebaseDatabase] Autentication failed: Invalid_token (audience was project 'a random project from my firebase console' but should have been project 'myProjectName'.
I thought maybe I had done something really goofy at first, so I deleted my project entirely and reinstalled a new google.plist and redid everything, but the only thing that has changed is now I'm just getting a different random project from my firebase project list.
What's goin' on here?
I had the same error as you got, but it only occurred in simulator.
To fix this issue I had to reset my simulators content and settings.
If anyone is experiencing this issue on an actual iPhone device rather than the simulator the root cause of this issue is provided in another SO thread:
Swift/Firebase Database invalid token error
It looks Firebase plan to address it in a future SDK update but to resolve it for now you must sign-out + invalidate your Firebase Database session in your 'old' project first:
NSError *error;
[[FIRAuth auth] signOut:&error];
if (error) {
ELog(#"Firebase Logout failed: %#", error.localizedDescription);
}
Your 'new' project should then now function as expected.
Maybe you are not taking the correct apiKey and authDomain. Go to Firebase, select the project go to Authentication and then Web Setup and see if the apiKey and authDomain are the same keys that you are using in the firebase.initializeApp({});

send grid & parse 502 Bad Gateway with nginx

I am trying to migrate my parse application over to digital ocean and followed this guide :
https://www.digitalocean.com/community/tutorials/how-to-migrate-a-parse-app-to-parse-server-on-ubuntu-14-04
Everything works perfectly fine until I get to the very end Test Parse Server ( Executing Example Cloud Code ) section
I tested the cloud code for the sample cloud code that was provided in the tutorial :
Parse.Cloud.define('hello', function(req, res) {
res.success('Hi');
});
so I got a Hi back in my browser as well as in postman.
See image here : https://cloudup.com/cH2dbBx1KTo

Then I test the function that uses sendgrid's service to send emails (http://blog.parse.com/announcements/introducing-the-sendgrid-cloud-module/), my cloud code file looks like this :
see image : https://cloudup.com/cD6MNRP3Tft
and now I try to run my post request from postman and I get an error even on my hello function that was working before
See image : https://cloudup.com/cIkwJ6552_5
So I look around and figure out that its an issue with my sendgrid import
var sendgrid = require("sendgrid");
sendgrid.initialize(“xxxxxx”, “xxxxx.”);
in these lines.
does anyone have any experience with digital ocean cloud code and send grid emailing service please help me out I will be grateful as this is the last step left and I will be done with my migration :)
cheers
Tanzeel
you have to specify server URL in parse config file. It is required and could be the reason why you cant run cloud code.
"PARSE_SERVER_URL": "http://localhost:1337/parse"
The url has be the same what you are using. There is also error in Nginx config in that tutorial, I explained it here https://serverfault.com/questions/765627/cannot-post-get-over-ssl/766428#766428
So I looked up at pm2 and to see real-time logs the command is
pm2 logs
at first when I ran the command I saw some errors, maybe they were there from before :
Then I tried the hello cloud function from postman app to test for its output in pm2 logs and I got the following :
Next I try to run my sendMail sendgrid function and I find out the the api-key I had used in my sendgrid function was throwing an error
ReferenceError: XXXXXXXXXXXX is not defined
So I went back to my cloud code and used quotes around my api-key parameter and passed it as a string in my send grid initialize function. Then I retry and get
[Error: The provided authorization grant is invalid, expired, or revoked]
So I went back to my sendgrid account and made sure that the api-key I was using was the correct one and it seemed to be just fine. I tested again and got the same error again so I decided to generate a new api-key just in case.
So I realize that I was not using the api-key but instead API KEY ID :
When we create a new api-key on sendgrid they give us the actual api key once and they ask us to store it in some secure place :
We can only display the key above one time. Please store it somewhere safe because as soon as you navigate away from this page, we will not be able to retrieve or restore this generated token.
So after I used an actual api-key I was able to send emails 😃
But one small issue still remains and I am not sure if its because of postman that I am using to run cloud code or something in the parse server or nginx that is still returning me with a 502 Bad Gateway as a response
But when I look at the logs for my parse server I do see a
parse-wrapper-0 { message: 'success' }
but it never gets back to me in my postman and instead I am getting a 502 error not sure why but the emails are being sent succesfully :)

Post to page at any time (offline access)

I'm trying to make a app that integrates into the WHMCS that will allows admins to set posts that will be put on their FB page's wall at a certain time.
I am using a piece of code that allows me to post to the page ok but when trying to run the PHP script from a CLI (Shell):
root#golf [~]# php -q /home/host/public_html/modules/addons/social/cron.php
I receive the following message:
Please check Facebook API settings, OAuthException: (#803) Some of the
aliases you requested do not exist: 0
Could someone please tell me what this message means and how I can get this working.
Also if I have not access the app from the web interface for a while the following message is displayed:
Exception: 102: parameters uid or session key required
A popup then appears on that page and it refreshes, the message is no longer there (until I come back a little later)
Would be great for as much help as I can get.
Daniel Collins.

Resources