I have developed typescript based SPA application (html,css,js) and have implemented authentication using Oidc-Client library.
Current Scenario :
- I was able to login and get access token successfully.
- Once it is timed out then it is not hitting silent renew page which is configured so that on token expiration it should be called.
- Also If I am accessing (kept opening) the silent renew page in one of tab in browser then it is invoking the token automatically.
Expected Scenario:
- On token expiration Silent renew page should be invoked automatically.
- I have attached sample configuration of web pack config and oidc config.
Can you please anyone help me on this to configure silent renew page in web pack config file and placeholder to be place in a project.
Web pack Config :
const config = {
devtool: "source-map",
watch: true,
entry: {
AuthSigninService:"./src/AuthSigninService/AuthSigninService.ts",
silentrefresh: ["./src/silentrefresh/silentrefresh.ts"]
},
resolve: {
extensions: [".ts", ".vue", ".html", ".js"],
alias: {
jquery: "../scripts/Jquery.js"
}
},
--------
new HtmlWebpackPlugin({
filename: "silentrefresh.html",
template: "./src/silentrefresh/silentrefresh.html",
chunks: ["polyfill","silentrefresh"]
}),
Oidc config:
var settings = {
authority: "https://xxxx.xxxxx.com/xxxx/v1",
client_id: "https://xxx.xxx.com/",
redirect_uri: "https://localhost:3000/taskpane.html",
post_logout_redirect_uri: "https://localhost:3000/logout.html",
revokeAccessTokenOnSignout: true,
response_type: "id_token token",
scope: "openid read:xxxx read:xxxx",
state: true,
filterProtocolClaims: true,
loadUserInfo: true,
nonce:true,
clearHashAfterLogin: true,
automaticSilentRenew: true,
silent_redirect_uri: 'https://localhost:3000/silent-refresh.html',
monitorsession:true,
metadata: {
issuer: 'https://xxx.xxx.com/xxx/v1',
authorization_endpoint: "https://xxx.xxx.com/xxxxx/v1/connect/authorize"
}
};