How to create a access token for the Hangout chat API by using OAuth 2.0? - chatbot

I am currently developing a google hangout chatbot.
For that, I need to know, how to create an access token for the hangout Chat API - REST API(https://developers.google.com/chat/api/guides/rest-api) without creating manually.
I have tried the OAuth 2.0(https://developers.google.com/identity/protocols/oauth2) concepts which do not work.
Also, Need to know how to create a private key for the service account in code level using app script/java/javascript
Kindly advise on this.

Related

How to use smartsheet API to get sheets which are upload by others

I am new to smart sheet. I need to use smart sheet API inside an Node Application to get sheets which are being uploaded by a user. I have gone through the documentation of smart sheet API. Document says to call API first need to get auth code which requires client_id. After getting auth code, need to get token.
I am not sure if I need to contact that user to get client Id or need to create new account. What should be my next step.
Having others use your application to get their data would require you to have them login to your app using their Smartsheet credentials. Then as the requests are made they can be done as that user. This is can be done by implementing the Smartsheet OAuth flow. There is more information on this in the Third-party App Development section of our API docs.
If you are using Node.js you can see a simple implementation of using our SDK on Github here.
As for the OAuth flow there is also an example of implementing that in Node.js on the Smartsheet Samples Github.

azure app authentication/authorization between apps

I have an azure mobile all that uses authentication/authorization with facebook, everything is setup and working on my mobile app, I’m able to authenticate with facebook and get an access token.
I also have a web app (ODATA) hosted in azure and also uses authentication/authorization with facebook and its also working fine if I try to access the ODATA service it redirects me to facebook to login.
According to this article (https://azure.microsoft.com/en-us/blog/announcing-app-service-authentication-authorization/) I should be able to silently or programmatically send the access token from the mobile app to the web app by sending a json with acces_token key.
The may question is how I do this, is that access token in the header or where should I write it I can find any information from it. I would really appreciate a code example or an article that can guide me to accomplish my task
The may question is how I do this, is that access token in the header or where should I write it I can find any information from it. I would really appreciate a code example or an article that can guide me to accomplish my task.
Based on my understanding, you are using Client-managed authentication for independently contacting the facebook then retrieve the access_token from facebook, then you could leverage the access_token to login with your azure mobile app backend.
Also, you have a Azure Web App uses authentication/authorization with facebook and use the same facebook App ID. Then you want to leverage the access_token in your mobile client to access your another Azure Web App. At this point, you could login with your azure web app and retrieve the authenticationToken as follows:
POST https://{your-app-name}.azurewebsites.net/.auth/login/facebook
Body {"access_token":"******"}
Then, you could leverage the authenticationToken and set it as the x-zumo-auth header when accessing your azure web app as follows:
Get https://{your-app-name}.azurewebsites.net/api/values
Header x-zumo-auth:{authenticationToken}
Additionally, you could create your custom Web API endpoints within your azure mobile app, details you could follow adrian hall's book about Custom HTTP Endpoints.

Difference between Authenticating user into my website using gmail account and googleplus account

I am developing a website, where users will can login using their Google account. When i was about to develop this feature i came to know about two things
Gmail api
Google+ api(social)
I want to know want is the difference between these two apis, why google is providing two different apis for authentication. I tried using google+ api, and if the user doesn't have an account in Google+ then google is forcing user to register into google plus and then login to my website.
Which one is better to use for authentication into our website google or google+?
If you will use Google plus Api for authentication process then user need to have google plus account and If user is not having google plus account then He need to create it
I suggest you to use Google api for authentication because you can get basic information with it but if you want to get all social media data of google plus then you have to use google Api
Simple - API calls do not access any private user data
Authorized - API calls can read and write private user data, or the applications own data - API key plus OAuth 2.0 credentials (different for different application types)

how can get data from facebook api and write those data in my own database using web services?

For this task I have already created my own facebook application to get the API key and secret key. Can anyone explain the next steps that should be done to
1) Read from facebook API
2) Write my own database
by using web services
Thanks in advance!
A high level answer:
I'm assuming you want to use the authorization code OAuth flow (this means you want Facebook users to give you access to their profiles so you can grab data from there). If so, you need to bring up a web server and an application that will run your users through the Facebook OAuth flow. In case you just want to access Facebook with your own credentials you don't have to have a web server, simply use the client credentials OAuth flow.
So, Once you have a valid access token, you simply make calls to Facebook API using this token. using Facebook Graph API is simply a matter of calling URLs and getting the data as JSON.
You can test-drive the API here.
BTW, according to Facebook's platform policy, you're only allowed to store Facebook data for caching purposes.
Let me know if this helps.

REST Api Authentication per users in App

I am creating a REST API server. For each app I have provided API key and secret. Example apps are Web app, mobile app any other app who want to use my api service. Now my API service will also need user authentication. How do I implement that? I have already done app authentication using hmac signature generation. Now I need help on implementing user authentication on those apps.
I can recommend you use OAuth or OAuth2 concept because it's standardized and widely adopted. You will be also able allow users to login with Facebook, Google account, etc.