when using email/password authentication with firebase I am getting an error trying to log a user in
calling .signInWithEmailAndPassword(email, password)
it hits this endpoint https://www.googleapis.com/identitytoolkit/v3/relyingparty/verifyPassword? which returns a 400. The error contains:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "keyExpired",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}
This has only started happening in the last day, but it is hard to tell from the HTTP response if this is an error on my end or google's. It return a 400 but then says internal error.
There are not meant to be any usage limits or key expirations for firebase so I am lost as to what is going on here
Related
I cant get commerce.js to process transaction in the ecommerce website tutorial im following. Whenever i attempt a transaction it says
{
"status_code": 402,
"error": {
"message": "The specified payment method requires further verification",
"type": "requires_verification",
"param": "pi_3KuHUGSCnOzTd5gv1y7qWTUS_secret_UPSucrdQSjwfWzMRksWZkN3Sv"
},
"help": {
"slack": "http://slack.commercejs.com",
"_comment": "*help* & *console* error responses will not be returned when using production/live API keys."
}
}
in the commerce js logs, but im using test keys and the card 4242424242....
Log from Commercejs
I want to reference the POST body in my tests.
Raw post body
{
"AppName": "application1",
"AppVersion": 1,
"DeviceId": "UnitTestDevice",
"UserName": "test1"
}
Tests
console.log(body.UserName);
This returns an error saying: "ReferenceError: body is not defined"
How do I go about referencing UserName in my tests?
You can log it by using:
console.log(pm.request.body);
(for the request)
or
console.log(responseBody);
(for the response)
In your specific case, let's assume that you want the request. Then:
console.log(JSON.parse(pm.request.body).UserName);
I'm having a bit of difficulty getting my simple Azure Function to dump a JSON payload into a CosmosDB. Here is the desired setup:
[HTTP TRIGGER] -> [JS FUNCTION] -> [INSERT JSON TO COSMOS DB]
I've added a cosmosDB output binding via Integrate in the web console
I know this part works because it will auto-create the collection upon running.
However, this is where my success ends.
I've included my code here. Maybe there is something obvious that I have missed:
function.json
{
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req"
},
{
"type": "http",
"direction": "out",
"name": "res"
},
{
"type": "documentDB",
"name": "outputDocument",
"databaseName": "outDatabase",
"collectionName": "MyCollection",
"createIfNotExists": true,
"connection": "mydocdb_DOCUMENTDB",
"direction": "out"
}
],
"disabled": false
}
index.js
module.exports = function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
context.bindings.outputDocument = {test: "hello world"}
context.done();
};
snippet output of context.log(context)
I've also peeked into the context variables, and it seems that the outbund bindings not there. I would have expected to see outputDocument here:
bindings:
{ req:
{ originalUrl: 'https://log-ugly-url-here',
method: 'POST',
query: [Object],
headers: [Object],
body: [Object],
params: {},
rawBody: '{\n "name": "Azure"\n}' } },
bind: [Function],
Executing this function in the portal gets a 200 OK, but no values show up in my cosmosdb collections.
No errors are shown anywhere.
Can anyone see what I might have missed?
Updates
It was recommended that I try to use JSON.stringify() around the payload, per this document:
context.bindings.outputDocument = JSON.stringify({test: "hello world"});
However, this has not resolved the issue. I've noticed that the documentation under the binding config sections does not recommend this strategy.
Update - Nov. 8, 2017 (10:12 AM)
I was using the Data Explorer blade in azure to see if there were results in my collections. I decided to use Robo 3T Mongo client. Now, when I query the collection I get the following error:
Error: error: {
"_t" : "OKMongoResponse",
"ok" : 0,
"code" : 1,
"errmsg" : "Unknown server error occurred when processing this request.",
"$err" : "Unknown server error occurred when processing this request."
}
I tried to look at the logs for this cosmosdb, but no errors show up.
I ran into this as well. Kept banging my head until I saw this:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-integrate-store-unstructured-data-cosmosdb
“At this time, the Azure Cosmos DB trigger, input bindings, and output bindings work with SQL API and Graph API accounts only“
Looks like there is a bug in Azure that accidentally corrupts the database.
I have a JSON that looks like so:
{
"response": {
"event": "Other",
"time_opened": "2014-09-09 10:09:07",
"time_updated": "2014-09-10 09:34:55",
"name": "blablablablablabla",
"current_status": "blablabla
blablablablablablablablablablablabla
blablablablablablablablabla
blablablablablablablablabla
"
}
}
I get "Uncaught SyntaxError: Unexpected token" on JSON.parse. After research I couldn't figure out how to wrangle it. Sorry if duplicate, but I'm a little lost here.
The problem was resolved with appropriate encoding server side.
I am using Kony studio for an app development. I have done the login validation using Eclipse to code for creating web services to connect to the oracle10g database. But on the front end I'm getting an error, when I'm trying to connect the front end to the web service.
The status==400 is getting validated but I'm not getting opcode as 0, instead its going in the else statement and giving an error alert. This is the Javascript code for connecting to the web service.
Please help. What does opstatus==0 signify?
function GetLogin()
{
var Userid =login.txtloginuname.text;
var Password = login.txtloginpass.text;
var inputParamsLogin={serviceID:"servicelogin",uname:Userid,pass:Password}
if (Userid!=null && Userid!="" && Password!="" && Password!=null)
{
appmiddlewareinvokerasync(inputParamsLogin,loginCallBackresponse);
}
else
{
var alert_seq5_act0 = kony.ui.Alert(
{
"message": "Please Enter User name and password",
"alertType": constants.ALERT_TYPE_ERROR,
"alertTitle": "",
"yesLabel": "OK",
"noLabel": "",
"alertIcon": "",
"alertHandler": null
}, {});
kony.application.dismissLoadingScreen();
}
function loginCallBackresponse(status,loginResults)
{
if(status==400)
{
alert("productResults");
if(loginResults.opstatus==0)
{
alert("inside opstatus");
else
{
var alert_seq5_act0 = kony.ui.Alert({"message": "Service Failed:"+loginResults.errmsg,
"alertType": constants.ALERT_TYPE_ERROR,
"alertTitle": "",
"yesLabel": "OK",
"noLabel": "",
"alertIcon": "",
"alertHandler": null}, {});
kony.application.dismissLoadingScreen();
}
}
}
}
I am getting the alert "product results" but unable to get the alert "inside opstatus".
Instead I'm getting "service failed alert.
If the opstatus is 0, it indicates that the service call is a success while a non-zero value indicates a failure.
Please read the following that gives you more info on network call in Kony
The following is the description of the parameters associated with network call in kony:
status - an integer value - indicating the status
The following are the various status returned:
100 - network call initiated successfully - resultset will not be available and it is nil.
200 - network is in progress (when you start receiving the 1st byte) - resultset will not be available and it is nil.
300 - network call canceled - resultset will not be available and it is nil.
400 - network call is finished (gets called in both success and failure scenarios - actual state can be queried using opstatus in the resultset.
Note: On Mobile Web, the callback function is always invoked with a status of 400. Other intermediate status codes are not applicable on Mobile Web.
resulttable - a Object with key-value pairs - follows the same structure (opstatus, errcode, errmsg along with the actual network returned data)
This represents the Object returned by the service. This Object contains three values:
opstatus
errcode
errmsg.
If the opstatus is 0, it indicates that the service call is a success while a non-zero value indicates a failure.
If the opstatus is a non-zero value, it is captured in errcode. The following are the possible error codes:
1000- Unknown Error while connecting (If the platform cannot differentiate between the various kinds of network errors, the platform reports this error code by default).
1011 - Device has no WIFI or mobile connectivity. Please try the operation after establishing connectivity.
1012 - Request Failed.
1013 - Middleware returned invalid JSON string.
1014 - Request timed out.
1015 - Cannot find host.
1016 - Cannot connect to host.
1200 - SSL - Certificate related error codes.
The error message corresponding to each error code is captured in the errmsg parameter.