Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SubscribeToTopic() results in 401 #439

Open
metodiobetsanov opened this issue Nov 25, 2024 · 1 comment
Open

SubscribeToTopic() results in 401 #439

metodiobetsanov opened this issue Nov 25, 2024 · 1 comment

Comments

@metodiobetsanov
Copy link

metodiobetsanov commented Nov 25, 2024

[READ] Step 1: Are you in the right place?

  • For issues related to the code in this repository file a Github issue.
  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: Ubuntu 22.04.5 LTS
  • Firebase SDK version: 3.1.0
  • Firebase Product: Firebase Cloud Messaging
  • .NET version: 8.0.10
  • OS: Ubuntu

[REQUIRED] Step 3: Describe the problem

We have 2 projects on GCP, project A is used to host workloads on GKE, and project B is set with Firebase
We have a service/api that will handle notifications requests from client apps and will send them to FCM.
The authentication is done via ACD and workload federation, the SAs are given all permissions required.
We are able to send notification and data messages to the devices, but when we send a subscribe to topic request we get 401

Steps to reproduce:

  1. intiialize the default instace for the app,
  2. get the messaging service
  3. use SubscribeToTopicAsync to subscribe a device/s to topic

Relevant Code:

FirebaseApp app = FirebaseApp.Create(
new AppOptions
    {
        ProjectId = firebase_project_id,
        Credential = GoogleCredential.GetApplicationDefault(),
    });
var firebaseMessaging= FirebaseMessaging.GetMessaging(app);

TopicManagementResponse response = firebaseMessaging
                                                    .SubscribeToTopicAsync(new[] { "device_token" }, "test_topic")
                                                    .GetAwaiter()
                                                    .GetResult();

@google-oss-bot
Copy link

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants