Google Web sign throws 400 error out of the blue - google-signin

Google Web Sign (JS) suddenly stopped working in our products today - out of the blue with a 400 error with the following error message:
{
"error" : "invalid_request",
"error_description" : "Parameter not allowed for this message type: prompt"
}
We traced the breakage to the "prompt" sign in option config. In the following code, as soon as commented out the prompt config, it worked.
gapi.client.init({
client_id: clientId,
cookiepolicy: 'single_host_origin',
prompt:"select_account",//commenting this code out stopped the breakage
discoveryDocs: DISCOVERY_DOCS,
scope: SCOPES.join(" "),
}).then(function () {
//we do something with it
});
Screenshot: https://www.evernote.com/l/AAK5kGGdJp9EkJC0lafcuREnLrNFt-u5muY
This was previously working code, the "prompt" parameter is still supported as per the documentation (see here).
This bug proved enormously expensive for us as we are in the middle of a campaign with lot of users attempting to register for the first time with our product.

Related

Fetching messages from empty channel results in 403 in Microsoft Teams

I'm having issues with extracting channel messages from a Microsoft Team. I have a javascript app that crawls through all Teams in a organization and extract the number of messages from all channels in all the teams. It works wonderfully in that it return the correct amount of messages, the problem is that when the app try to fetch a message from a channel where no one have made a message in the channel there is an HTTP error with the ErrorCode 403 (forbidden). Even though the app is successful in that it delivers on what it is supposed to do, I can't have an application that sends 50 angry, red messages every time it makes a http call.
The call I am using is the following
https://graph.microsoft.com/beta/teams/{teamID}/channels/{channelID}/messages
Does anyone know if this is solvable? If not is it possible to check if a channel is empty? And if that is not an option; is there anyone to hide those dirty error messages from the console?
Edit #1
To call to the api I used:
let header = new Headers();
header.append("Authorization", "Bearer " + accessToken);
header.append("Content-Type", "application/json");
fetch("https://graph.microsoft.com/beta/teams/232808c2-d500-47b0-9ead-e238c5e2ab95/channels/19:69a01be632994d123014bbae1aa5db1e#thread.tacv2/messages", {method:"GET", headers: header})
Edit #2
I response object seems to be correct:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#teams('90baabba-1b5e-471c-a163-8a9b4b680de7')/channels('19%3A01c741f599e547f0b9b38296283b7fec%40thread.skype')/messages",
"#odata.count": 0,
"value": []
}
The problem is that in when I look in Google Chrome > Dev tools > Console, the fetch still displays the error:
GET https://graph.microsoft.com/beta/teams/4f460179-4691-42e5-8677-9101dcdb65fe/channels/19:3497f5b8f9f54149919631b32d21e608#thread.tacv2/messages 403 (Forbidden)
And when I console log the error it just displays as:
error: {code: "Forbidden", message: "Forbidden", innerError: {…}}
Only team members are allowed to read messages. Admins can do team management i.e. CRUD operations on teams, channels, tabs etc. They however cannot read messages. This is intentional and we do not have plans to change this in near future

Add-on receives errors for accessing active sheet, and user info

My Add-on has been published and has been working for some time, and the published version available for about 3-4 weeks, available in the Add-on store for sheets. It has 8 users. School Announcements Easy works with a form and a sheet to automate the production of daily bulletins from form submissions.
One of the functions removes old submissions based on a date selected by the user. In June it stopped removing old data. Testing from the developer account shows it still works. I thought perhaps the date format was causing it to hang up, but it works regardless of date format, but not in my account at my school/workplace. Only in my developer account.
I looked in the API Console linked from Resources -> Cloud Platform Project in the code page. I have two errors:
You do not have permission to perform that action. at unknown function
With the associated Stackdriver notification:
{
insertId: "1orur8efqvxg4e"
jsonPayload: {…}
labels: {…}
logName: "projects/project-id-xxxxxxxxxxxxx/logs/script.googleapis.com%2Fconsole_logs"
receiveTimestamp: "2018-06-01T14:54:57.277315484Z"
resource: {…}
severity: "ERROR"
timestamp: "2018-06-01T14:54:56.269Z"
}
My add-on's code at bullMenu:18 is var ss = SpreadsheetApp.getActiveSpreadsheet(); This error shows up a lot!
The other error is more troubling to me:
The script does not have permission to get the active user's identity.
With the associated Stackdriver notification:
{
insertId: "g3dkpzf2htk4x"
labels: {…}
logName: "projects/project-id-xxxxxxxxxxxxxxxxxxxx/logs/script.googleapis.com%2Fconsole_logs"
receiveTimestamp: "2018-06-01T14:55:50.288011162Z"
resource: {…}
severity: "WARNING"
textPayload: "The script does not have permission to get the active user's identity."
timestamp: "2018-06-01T14:55:49.286Z"
}
To my knowledge I did not write any code that requests the user's identity.
Any clues on how to track these down would help. It seems they may be connected in some way, and only started on June 1. Prior to that, it worked great.
I did make an attempt to install FireBase and added code to the head of one of the pages as follows:
<script src="https://www.gstatic.com/firebasejs/5.0.4/firebase.js"></script>
<script>
// Initialize Firebase
var config = {
apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
authDomain: "xxxxxxxxxxxxxxxxxxxxxx.firebaseapp.com",
databaseURL: "https://xxxxxxxxxxxxxxxxxx.firebaseio.com",
projectId: "xxxxxxxxxxxxxxxxxxxxxxxxx",
storageBucket: "xxxxxxxxxxxxxxxxxxxxxxxxxx.appspot.com",
messagingSenderId: "xxxxxxxxxxxxx"
};
firebase.initializeApp(config);
</script>
It seems likely that this is the culprit, that I may be using Firebase improperly or have the wrong version. I'm adapting to writing add-ons, but FireBase is totally new to me, and seems essential.
Any ideas?

Error on google actions "App testaction-fff11 was not found. The app preview may have expired"

I followed the steps illustrated in documentation:
https://developers.google.com/actions/assistant/updates/notifications
But in the last step when I try to send a notification the api "https://actions.googleapis.com/v2/conversations:send" reply with this error.
{ code: 404,
message: 'App testaction-fff82 was not found. The app preview may have expired.',
status: 'NOT_FOUND' } }
I don't understand just what is not there.
Permission is granted, intent is configurated, the credentials work, the application is the right one.
Has anyone happened to the same thing?
Self answer: as described here the "locale" field must be specified

Stuck on "Redirecting you back to the application. This may take a few moments." part on twitter authorization - with the twitteR package

I had the exactly same issues as described in this question, in which I got similar errors. But I've followed instructions, changing the callback url and a new issue came up. I get to the authorization part through my browser but I keep getting stuck in loading page with the the warning "Redirecting you back to the application. This may take a few moments." and instead of being redirected, the browser stops and warns that it can't reach the page - also, RStudio crashes right after it. What should I do? I tried searching for similar questions, but I haven't been able to find a solution.
Although this a bit repetitive, here it is the code in R:
library(twitteR)
Consumer_key <- "key"
Consumer_secret <- "secret"
setup_twitter_oauth(Consumer_key,Consumer_secret, access_token=NULL,access_secret=NULL)
[1] "Using browser based authentication"
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort
I had this problem but in node.js, it was because I wasn't calling the passport callback function once Twitter was done with my authentication
Not sure if this helps, but here's what fixed it.
passport.use(new TwitterStrategy({
consumerKey: process.env.TWITTER_CONSUMER_KEY,
consumerSecret: process.env.TWITTER_CONSUMER_SECRET,
callbackURL: "http://127.0.0.1:8080/passport/twitter/callback"
}, function(token, tokenSecret, profile, cb) {
// debug(token);
// debug(tokenSecret);
// debug(profile);
cb(); // Was missing this line
}));

Actions on Google responds with "Sorry, I didn't get any response."

I am following this code lab Facts about You: Build a conversational app for the Google Assistant
I had it working once but must have done something wrong because now all. To be 100% clear i have deleted everything on my pc downloaded the code from Git again deleted the project in actions console deleted the project in api.ai. This is the result of a completely new install. I have not changed anything in the code lab.
"Sorry, I didn't get any response."
The request apears to be sending corectly
From actions test:
{
"conversationToken": "CiZDIzU5Ym...",
"debugLevel": 1,
"inputType": "KEYBOARD",
"locale": "en-US",
"mockLocation": {
"city": "Mountain View",
"coordinates": {
"latitude": 37.421980615353675,
"longitude": -122.08419799804688
},
"formattedAddress": "Googleplex, Mountain View, CA 94043, United States",
"zipCode": "94043"
},
"query": "tell me about cats",
"surface": "GOOGLE_HOME"
}
Received in fire-base
[{"name":"actions.capability.AUDIO_OUTPUT"}]},"inputs":[{"rawInputs":[{"query":"tell me about cats","inputType":"VOICE"}],"arguments":[{"rawText":"tell me about cats","textValue":"tell me about cats","name":"text"}],"intent":"actions.intent.TEXT"}],"user":{"locale":"en-US","userId":"AETml1RzwqyijfbawqjZkRSXz-P1"},"device":{},"conversation":{"conversationId":"1504878811393","type":"ACTIVE","conversationToken":"[\"_actions_on_google_\",\"choose_fact-followup\"]"}}},"id":"3b97e239-346f-49a2-a106-96cfb6f69e92","timestamp":"2017-09-08T13:58:29.99Z","lang":"en","result":{"source":"agent","resolvedQuery":"tell me about cats","speech":"","action":"tell.cat.fact","actionIncomplete":false,"parameters":{},"contexts":[{"name":"_actions_on_google_","parameters":{"category.original":"headquarters","category":"headquarters","facts":{"content":{"headquarters":["Google has over 10 fitness facilities in its main campus."],"history":["Google was founded in 1998.","Google was founded by Larry Page and Sergey Brin.","Google went public in 2004.","Google has more than 70 offices in more than 40 countries."]}}},"lifespan":98},{"name":"actions_capability_audio_output","parameters":{},"lifespan":0},{"name":"google_assistant_input_type_voice","parameters":{},"lifespan":0},{"name":"choose_cats-followup","parameters":{},"lifespan":2}],"metadata":{"intentId":"14df3938-3776-477c-811c-d1758ecd15cb","webhookUsed":"true","webhookForSlotFillingUsed":"false","nluResponseTime":19,"intentName":"choose_cats"},"fulfillment":{"speech":"","messages":[{"type":0,"speech":""}]},"score":1},"status":{"code":200,"errorType":"success"},"sessionId":"1504878811393"}
Response returned to actions
{
"audioResponse": "//NExAARAA...",
"conversationToken": "CiZDIzU5Ym...",
"expectUserResponse": true,
"response": "Sorry, I didn't get any response.",
"visualResponse": {
"visualElements": []
}
}
I must be missing something. Firebase is receiving the request its just not responding correctly.
training image
That error on appears if your web hook doesn't provide a response to the assistant. The cloud function has been triggered or has timed out and not returned the JSON back to assistant to parse. Check to see what the output of the cloud function is and check it against the API.AI web hook format here https://developers.google.com/actions/reference/v1/apiai-webhook
It should look something like this:
{
"speech": "...", // ASCII characters only
"displayText": "...",
"data": {
"google": {
"expect_user_response": true,
"is_ssml": true,
"permissions_request": {
"opt_context": "...",
"permissions": [
"NAME",
"DEVICE_COARSE_LOCATION",
"DEVICE_PRECISE_LOCATION"
]
}
}
},
"contextOut": [...],
}
I think this is something on the Google's end. My application have been running on production for more than a week. Based on the logs everything was fine till 6 hours ago but since that the users don't get any answer back.
If I request on the API.AI the response is okay so it's not the firebase/fullfillment causing the issue.
Checked other applications some had the same problem some had no problem at all. Not sure what we can do here.
Errors like this are usually caused by a syntax error or other problem in your Firebase Function after you've updated it. There are a few good approaches to diagnosing problems like this:
Check the Firebase function log. If there is an error, it will almost certainly show up here.
From the command line you can use firebase functions:log to see the most recent logging messages. You can also use the console to view the logs by going to console.firebase.com, selecting the project, selecting Functions, and then the Logs tab.
If there isn't an error, it becomes more of a logic problem. Adding your own logs via console.log(), console.info(), or console.error()
Many times the logs will indicate the function is timing out after 60 seconds when you think you're returning things by then. Make sure you are completing any callbacks and calling assistant.ask() or assistant.tell() (or one of their cousins) to make sure they're being called.
After posting a question on the Google+ actions group. I got a response back from Google.
Actions Bug There is currently a bug in the Actions Platform that
might result in unexpected error messages when running your apps.
We are currently testing a fix and hope to have that rolled out soon.
As of 10 minutes ago it is working again. The code was correct all along.

Resources