0

I have developed typescript based SPA application (html,css,js) and have implemented authentication using Oidc-Client library.

Current Scenario :

  1. I was able to login and get access token successfully.
  2. 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.
  3. 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:

  1. On token expiration Silent renew page should be invoked automatically.
  2. 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"                  
   
}    
};
chennaiyan
  • 69
  • 1
  • 6
  • I did similar thing but not with chunks, I did not include the silent renew file in main bundle, copied the file into public folder using copy plugin and it worked for me. Did you try check you chunk to see only the silent refresh page is loading when you go to url or is it loading the entire site? – hashbytes Aug 26 '20 at 18:15
  • Thanks ...Now I one more observed that signredirectcallback not being successful getting in user which may also be the reason since the same scenario I verified in oidc vannila project.... So now I am trying to fix the issue "no state in response" When invoking signredirectcallback method.... Any idea did you come across the situation? – Muruga ananth Aug 27 '20 at 06:46
  • Hi any update please? – Muruga ananth Aug 28 '20 at 04:17

0 Answers0