logo
down
shadow

server to server auth failure - firebase - dialogflow - actions on google - user entity v2


server to server auth failure - firebase - dialogflow - actions on google - user entity v2

By : Dina Amin Gad
Date : November 21 2020, 04:01 AM
like below fixes the issue My code started working like before automatically It was happening due to an incident in google
code :


Share : facebook icon twitter icon
How do I use a firebase server timestamp, with queryStartingAtValue, to track a user's current actions, for a firebase l

How do I use a firebase server timestamp, with queryStartingAtValue, to track a user's current actions, for a firebase l


By : Rohit
Date : March 29 2020, 07:55 AM
wish of those help You can estimate the ServerTime by taking the local time and correcting for the clock-skew and latency. The Firebase documentation has a section on Clock Skew.
Clock Skew
code :
let offsetRef = FIRDatabase.database().referenceWithPath(".info/serverTimeOffset")
offsetRef.observeEventType(.Value, withBlock: { snapshot in
    if let offset = snapshot.value as? Double {
        let estimatedServerTimeMs = NSDate().timeIntervalSince1970 * 1000.0 + offset
    }
})
Where should the OAUTH2.0 Server be for Actions on Google/Firebase

Where should the OAUTH2.0 Server be for Actions on Google/Firebase


By : rcs
Date : March 29 2020, 07:55 AM
To fix the issue you can do First - you're starting with a small misconception. Actions on Google and the Actions SDK do not require Firebase Functions for fulfillment. Firebase Functions do make it easier - they provide the publicly accessible HTTPS endpoint that you need for a webhook, but if you have your own server (with valid SSL certificate) or if you want to use AWS Lambda or something similar, you can certainly do so. And if you want to use a language besides JavaScript, the JSON protocol used is documented (although sometimes not clearly).
To answer your questions:
How to link user account among google actions, mobile app, backend server and firebase auth?

How to link user account among google actions, mobile app, backend server and firebase auth?


By : W.Jackson
Date : March 29 2020, 07:55 AM
DialogFlow/Actions: Allow Google Assistant user to create Event in Google Calendar from Actions App

DialogFlow/Actions: Allow Google Assistant user to create Event in Google Calendar from Actions App


By : user413938
Date : March 29 2020, 07:55 AM
it helps some times Here are the "missing" steps after which I got this thing working. I am sure there must be alternate ways of doing this but I will suffice with this until I get some feedback here.
Note: Google Actions Console UI has changed so the screens in the original question maybe different (but are complete).
code :
string responseText = string.Empty;
string clientId = "DCuPWHknmv_k2xxxxxxxxxxxxxxxxx";     //Auth0 ClientId
string clientSecret = "7G3xlreFIULPZ9OtwlOxCX99xxxxxxxxxxxxxxxxxxx";    //Auth0 ClientSecret
string accessToken = jsonObject.SelectToken("originalRequest.data.user.accessToken").ToString();

try
{
    using (var httpClient = new HttpClient())
    {
        httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);
        var url = "https://xxx.auth0.com/userinfo";
        responseText = httpClient.GetStringAsync(url).Result;

        JObject jsonUserInfo = JObject.Parse(responseText);
        string userId = jsonUserInfo.SelectToken("sub").ToString();

        url = "https://xxx.auth0.com/oauth/token";
        var content = new FormUrlEncodedContent(new[]
        {
            new KeyValuePair<string, string>("client_id", clientId),
            new KeyValuePair<string, string>("client_secret", clientSecret),
            new KeyValuePair<string, string>("audience", "https://[domain].auth0.com/api/v2/"),
            new KeyValuePair<string, string>("grant_type", "client_credentials")
        });

        var postResult = httpClient.PostAsync(url, content).Result;
        jsonUserInfo = JObject.Parse(postResult.Content.ReadAsStringAsync().Result);
        accessToken = jsonUserInfo.SelectToken("access_token").ToString();

        httpClient.DefaultRequestHeaders.Remove("Authorization");
        httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);

        url = "https://xxx.auth0.com/api/v2/users/" + userId;
        jsonUserInfo = JObject.Parse(httpClient.GetStringAsync(url).Result);
        accessToken = jsonUserInfo.SelectToken("identities[0].access_token").ToString();
        userId = jsonUserInfo.SelectToken("identities[0].user_id").ToString();

        httpClient.DefaultRequestHeaders.Remove("Authorization");
        httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);

        url = "https://www.googleapis.com/calendar/v3/users/me/calendarList";
        responseText = httpClient.GetStringAsync(url).Result;
    }
}
Google Assistant/Dialogflow/Actions: how to get user's contacts?

Google Assistant/Dialogflow/Actions: how to get user's contacts?


By : Vicki Kuehnel
Date : March 29 2020, 07:55 AM
I hope this helps . Per Actions on Google policy, you should gain explicit access from a user to obtain their email address. You can do so by Account Linking in the Actions on Google project console:
Under "Account Linking" in the Actions on Google console, click on "Yes, allow users to sign up for new accounts via voice" and choose "Google Sign In" in the Linking Type field. In your webhook ask user to sign in with conv.ask(new SignIn('To get your account details')). Then, create a Dialogflow intent with the actions_intent_SIGN_IN event and allow fulfillment.
code :
app.intent('Get Signin', (conv, params, signin) => {
  if (signin.status === 'OK') {
    const email = conv.user.email
    conv.ask(`I got your email as ${email}. What do you want to do next?`)
  } else {
    conv.ask(`I won't be able to save your data, but what do you want to next?`)
  }
})
shadow
Privacy Policy - Terms - Contact Us © bighow.org