Service Worker operation in a keycloak application

Viewed 219

I am creating an application, where the login is done by the "Keycloak" service and a aplication in Angular.

When enabling the service worker and running local, it does exactly what is expected, displays a message informing the user of new system updates, see image below

However when I try to run in a production environment with https and everything, nothing happens, the service worker on the application tab is running there, depending on the location, but the message does not appear and if I try to run offline it also don't work. At first I think the problem is in the keycloak, but I don't know how to solve it.

my code

my ngsw-config

{
  "$schema": "./node_modules/@angular/service-worker/config/schema.json",
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "resources": {
        "files": [
          "/favicon.ico",
          "/index.html",
          "/manifest.webmanifest",
          "/*.css",
          "/*.js"
        ]
      }
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "updateMode": "prefetch",
      "resources": {
        "files": [
          "/assets/**",
          "/*.(eot|svg|cur|jpg|png|webp|gif|otf|ttf|woff|woff2|ani)"
        ],
        "urls": [
          "https://fonts.googleapis.com/**"
        ]
      }
    }
  ]
}

In short, is there any additional configuration to run service worker when authentication is done by the keyclock? I just need the message to appear in the production environment

0 Answers
Related