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

Using this library with UWP app "alternate channel" #48

Open
nbevans opened this issue Aug 9, 2018 · 1 comment
Open

Using this library with UWP app "alternate channel" #48

nbevans opened this issue Aug 9, 2018 · 1 comment

Comments

@nbevans
Copy link

nbevans commented Aug 9, 2018

Reference: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/alternate-channel-vapid-webpush

We've made a UWP app which calls the CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync API. This returns a endpoint URL which contains a token in the query string of the URL. No p256dh or auth parameters are returned by this API.

I'm unclear now how to proceed because every WebPush library, including this one, seems to require as a minimum the endpoint, p256dh and auth to form a complete "push subscription".

The documentation on the MSDN there, as you can see, is extremely vague!

I have generated a VAPID public+private key pair and that part seems fine. I am passing in the public key part of this into that CreateRawPushNotificationChannelWithAlternateKeyForApplicationAsync function as the appServerKey parameter. But am now unclear what to do in order to get the p256dh and auth parts which appear to be essential.

Any ideas/tips would be greatly appreciated! Thank you.

@tuwrraphael
Copy link

In the reference linked is a note on encryption, which states:

You can use whatever encryption scheme you find more useful for your app…

So if you'd really like to use this library, whose goal is to implement the web push standard in c#, I would suggest to go along with the end-to-end protection of the payload.
You would need to generate the p256dh and auth keys yourself, in your client application, and transmit them together with your endpoint url to your server. You need then to decrypt the payload in the client.

If you don't want to encrypt the payload this way, this package is not the right one I'm afraid. Still, I would like the solution of building an own package for the VAPID authentication header, which could then be imported here.

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

No branches or pull requests

2 participants