Skip to content

403 Forbidden for Chrome #212

Open
Open

Description

@zhangms143

I'm trying to use web-push to push messages, and it works fine on Microsoft Chrome, but Google Chrome gets error 403 Forbidden.(Use the same key pair)

return message: the VAPID credentials in the authorization header do not correspond to the credentials used to create the subscriptions.

How do I fix it?

Activity

  1. Thor-Erling commented on May 14, 2024

    @Thor-Erling

    I had the same issue, and found a fix on the problem and replaced the code in the following lines

    ---- AbstractPushService.java ----
    Line 211:  headers.put("Crypto-Key", headers.get("Crypto-Key") + ";p256ecdsa=" + Base64.getUrlEncoder().withoutPadding().encodeToString(pk));
    Line 212:  headers.put("Crypto-Key", "p256ecdsa=" + Base64.getUrlEncoder().encodeToString(pk));
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions