Implementing silent renewal of authentication token with Identity Server 4 and oidc-client.js is almost trivially easy, provided you set all the appropriate configuration settings on server (RedirectUris) and client (automaticSilentRenew, silent_redirect_uri).

And it works a treat...until it doesn't. Handling the silent renew callback in our Aurelia app through an Aurelia component worked - provided you are on the browser tab where the app is running when the silent renew request is made. If not, the request to the server is made, but the callback fails with a Frame window timed out error.

I couldn't get to the bottom of it and none of the issues with same error reported against the oidc-client-js project applied.

The solution was to handle the silent signin callback in a html file instead of in an Aurelia component, similar to the solution described at Silent Refresh - Refreshing Access Tokens when using the Implicit Flow

<head>
    <title></title>
</head>
<body>
<script src="/scripts/oidc-client.min.js"></script>
<script>
    new Oidc.UserManager().signinSilentCallback()
        .catch((err) => {
            console.log(err);
        });
</script>
</body>