Google Cloud Api Authorization - google-cloud-platform

I want to use google cloud pub sub to implement Facebook kind of notifications in blog application which has following architecture
I have a both web and android device as a client for rest services exposed.
Those rest services has been secured using OAuth2 (spring security).
When user create a blog then if someone comment on that post, the concern owner can get the notifications. Only authorized user can create a post or comment and the concern person can see the notifications
I don't want user to authorize again with Google so how I can incorporate the api's in my architecture using pull notification

You typically wouldn't use Google Cloud Pub/Sub in the client in the type of setup you describe. Cloud Pub/Sub isn't designed to scale to a number of subscriptions that are on the order of number of phones. Instead, you'd want to use Firebase Cloud Messaging. Firebase has a model that handles registration of devices to receive messages that is more in line with what you are thinking of, e.g., Set Up a Firebase Cloud Messaging Client App on Android and
Implementing a Firebase Cloud Messaging Client on Chrome
What you may use Cloud Pub/Sub for is communication between different services. For example, perhaps the service that handles blog posts publishes messages on a Cloud Pub/Sub topic that your notification service subscribes to. The notification service would process the message and send out Firebase Cloud Messaging messages to end users as appropriate.

Related

IAP status changes not trigger the refund cloud functions while sending test message from google play console send and pulled successfully

Here’s what I do:
Set up a Cloud Pub/Sub using my own Google Cloud Platform (GCP) project.
Create a topic
Allow Google Play to publish notifications on the topic.
Tell my Google Play Console about my topic.
Get the Authentication Key for your Backend .
Added backend service as a subscriber to the topic .
----> faild here notifications not triger my cloud functions
Verify that receiving the notifications.
Update your backend with the new subscription change .

Is there a way to Connect your Google Reviews into a Django Website?

been looking for a tutorial whereby one can connect automatically the reviews they receive from Google My Business and add them as testimonials to a Django Website.
Via the Google Business Profile APIs, it is possible to receive Pub/Sub notifications for new or updated reviews. You would have to set up a Pub/Sub topic to which Google will send these notifications. A Pub/Sub subscription would then need to process these notifications and save the fetched review data to a database of choice.
The prerequisites for this are that you were granted access to the Google Business Profile APIs in the first place and that you have acess to those GBP locations.

Can I publish an event into Cloud Pub/Sub outside from GCP

Can I publish an event into Cloud Pub/Sub outside from GCP?
Let me clarify my query a bit. In AWS as we are able to publish events into SNS topics directly by invoking REST API via API Gateway from the non-cloud client (https://github.com/cdk-patterns/serverless/blob/master/the-big-fan/README.md), is there any such method in GCP to publish an event into Pub/Sub?
I can see there is a similar question in SO (Acces Google Pub/Sub from outside of GCP), but it is not fully answered my question I believe. Yes authentication is required and it is a cross-cutting functionality, but what is the basic technic to publish an event in Pub/Sub outside from GCP
Yes, you can publish a message into a topic, and then pull it, or even have PubSub deliver it to you through a Push subscription.
When publishing a message, or pulling it from a subscriber, you can access PubSub through the REST or RPC API. In addition, you can use one of the client libraries.
Here you can find an example of how to publish a message using the gcloud CLI tool, an example with the REST API, python and java among other programming languages.
As mentioned in the question referenced, you will need to authenticate in order to either publish a message, or pull it. You can use the quickstart as a reference on how to do so. Notice that you can follow the quickstart from any computer or VM outside GCP.
Finally, if you're using Push subscriptions to receive your messages, your endpoint will need to be a publicly accessible HTTPS address and have a valid SSL certificate signed by a certificate authority. Again, this endpoint can live outside GCP.

Is it necessary to use Amazon SNS when using Firebase Cloud Messaging (FCM) on AWS to send notifications?

I have an existing mobile app that can receive push notifications and I have an existing backend application that exposes an API for sending notifications to the app. The backend application uses Firebase Cloud Messaging (FCM), so it could be considered a wrapper around FCM. My backend application uses the Firebase Admin SDK to create messages and send them to Firebase. My customers hit an API exposed by my backend application (so, if we assume that the customer is using Postman, then the flow for sending a message is: Postman->My backend application->Firebase->Mobile app).
Until now I have been running my backend application on a local server, and it works fine. But now I need to deploy this on AWS. My question is: is it necessary to use Amazon SNS or not? I don't really need any additional functionality from AWS, I just want AWS to permit the required communication.
For example, I dont need to go to an AWS interface to enter the token to send messages to my phone. I already have an API exposed through my backend for sending messages. So, should I even bother to set up SNS?
I know that at a minimum I will have to make my firebase project google credentials available to my instance on AWS (in a file located at the path specified using GOOGLE_APPLICATION_CREDENTIALS). What other configuration steps would be needed? Thanks a lot.
After some investigation I found that it is not necessary to use Amazon SNS to achieve what I wanted to achieve.
I was able to deploy my server application (which uses Firebase Cloud Message) to AWS, and the messages arrive on the mobile phones without any problem.
I initialized my backend application using the steps described on the Google Firebase site: https://firebase.google.com/docs/admin/setup

How to Authenticate an External Publisher in Google Pub/Sub?

I am trying to obtain data from a web service (publisher).
The web service lets me send the data (message) to any url through a webhook. My plan is to send it to a Google Pub/Sub topic.
However, Google Pub/Sub is not recognizing this third-party web service. It is returning a http 401 response code, meaning that the web service is not authenticated.
My question is, How can I authenticate it?
Authentication for requests made to Google Cloud Pub/Sub or any other of the Google Cloud Platform services can be accomplished in a couple of different ways. In your case, where you want to make a direct request via the REST API, you'll need to create a service account and authenticate via OAuth 2.0. The Using OAuth 2.0 for Server to Server Applications guide details the process. If the web service you are using supports OAuth 2.0 authentication for requests it makes, then you should basically be set. If it does not, then you will have to take care of acquiring access tokens (and acquiring new ones when they expire) manually.