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

Consider migrating to FCM HTTP v1 API [old API shutoff: June 2024] #313

Closed
ilya-korotya opened this issue Jul 7, 2022 · 15 comments
Closed

Comments

@ilya-korotya
Copy link

Is your feature request related to a problem? Please describe.
FCM asks to stop using legacy authorization and switch to OAuth 2.0 https://firebase.google.com/docs/cloud-messaging/auth-server. But it looks like sygnal only supports authorization via Authorization:key=AIzaSyZ-1u...0GBYzPu7Udno5aA which is the old approach.

Describe the solution you'd like
Add a field to the config that will determine what type of authorization I want to use. Legacy or OAuth 2.0.

Additional context
image

@reivilibre
Copy link
Contributor

Can you clarify: are you still able to create a legacy API key or have they shut that off completely now?

@ilya-korotya
Copy link
Author

ilya-korotya commented Jul 7, 2022

Using a legacy API key is still allowed, but not recommended. I think FCM may stop supporting legacy API key at any time.

@H-Shay
Copy link
Contributor

H-Shay commented Aug 8, 2022

The issue here is that AFAICT Sygnal currently uses the legacy HTTP API

GCM_URL = b"https://fcm.googleapis.com/fcm/send"
, which doesn't support Oauth token authorization. We probably need to consider migrating to the HTTP v1 API although I don't see any concrete info in the docs relating to a sunset date for the legacy API.

@H-Shay H-Shay changed the title Support OAuth 2.0 on FCM Consider migrating to FCM HTTP v1 API Aug 8, 2022
@rltas
Copy link

rltas commented Feb 16, 2023

The readme says "server key" but since the parameter is called "api_key" it still took us some time to realize that we explicitly have to enable the "Cloud Messaging API (Legacy)" and use that. If this migration isn't something that can easily be done, maybe just be a bit clearer/explicit about that.

@popperwin
Copy link

We probably need to consider migrating to the HTTP v1 API although I don't see any concrete info in the docs relating to a sunset date for the legacy API.

@H-Shay
The legacy API will be shutdown on 20 June 2024

image

@H-Shay
Copy link
Contributor

H-Shay commented Aug 4, 2023

The legacy API will be shutdown on 20 June 2024

Thanks for the heads up!

@AndrewBedscastle
Copy link

AndrewBedscastle commented Aug 9, 2023

I'd recommend having a look at the firebase admin SDK which is also available for python
https://firebase.google.com/docs/cloud-messaging/server#firebase-admin-sdk-for-fcm
We needed to migrate a lot of projects using the legacy GCM API and found admin SDK to be the most easy.
I do not know it for python (we're not using python), but for Java it offers very convenient builders for messages.

Python example:

# This registration token comes from the client FCM SDKs.
registration_token = 'YOUR_REGISTRATION_TOKEN'

# See documentation on defining a message payload.
message = messaging.Message(
    data={
        'score': '850',
        'time': '2:45',
    },
    token=registration_token,
)

# Send a message to the device corresponding to the provided
# registration token.
response = messaging.send(message)
# Response is a message ID string.
print('Successfully sent message:', response)[cloud_messaging.py]

source: https://github.com/firebase/firebase-admin-python/blob/59a22b3ef3263530b1f1b61a3416ef311c24477b/snippets/messaging/cloud_messaging.py#L24-L40

PS: I am pretty sure that the deadline will be extended by Google. They won't shut every down in June 2024. One should be prepared, though.

@reivilibre reivilibre changed the title Consider migrating to FCM HTTP v1 API Consider migrating to FCM HTTP v1 API [old API shutoff: June 2024] Aug 17, 2023
@giomfo
Copy link
Member

giomfo commented Sep 27, 2023

@wrjlewis FYI this is not possible to configure a FCM (Firebase Cloud Messaging) pusher for a new Firebase project in a Sygnal instance since June 2023.

Here is a screenshot of a new Firebase project settings in the Firebase Console:
Screenshot 2023-09-27 at 10 06 41

Only FCM HTTP v1 API is allowed for a new project.

June 2024 is the deadline for the existing projects. We should migrate asap to unblock new projects

@bruno24pt
Copy link

Quick check-in about the legacy API deadline in June. Heard Element-HQ moved all the stuff over, but can't see Sygnal Pushgateway. Maybe it's still in the pipeline?

Any updates or details on this? Just trying to stay in the loop.

Thanks for any info!

@wrjlewis
Copy link

Hey 👋

Heard Element-HQ moved all the stuff over, but can't see Sygnal Pushgateway. Maybe it's still in the pipeline?

Yep thats correct, Sygnal will be moved over shortly.

Any updates or details on this? Just trying to stay in the loop.

I can't give specifics on when exactly. But we're trying to get this scheduled asap and well ahead of the API shut off date. Lack of specifics on that just due to the team's other commitments and being a smaller team.

@franzos
Copy link

franzos commented Mar 15, 2024

This is coming in like ~3 months.
Is anyone working on this?

@giomfo
Copy link
Member

giomfo commented Mar 15, 2024

@devonh can we consider this ticket closed by #361? is there still any pending work?

@wrjlewis
Copy link

Support has been added in today's release - https://github.com/matrix-org/sygnal/releases/tag/v0.14.0

@bmarty
Copy link

bmarty commented Jun 17, 2024

FTR, this is an e-mail I have received today:

image

@rltas
Copy link

rltas commented Jun 18, 2024

We’d like to let you know that due to the high number of extension requests, we have decided to delay the shutdown time to July 20, 2024.

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