question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Silent Renew doesn't get invoked

See original GitHub issue

I’ve tried to follow your example of setting up silent renew but I’m unable to get it to work. I’ve tried to read the documentation and code to find any events that gets triggered when silent renew is invoked.

Whats different in my source than your example is that I invoke authorization imediately when the user hit our app (as implemented in one of your examples).

When I set the silent_renew to true I can see that there is created an iFrame in the DOM named myiFrameForSilentRenew, but this iFrame is empty, from Developer Tools > Elements I can see the structure of the iFrame:

<iframe id="myiFrameForSilentRenew" style="display: none;">
   #document
   <html>
       <head></head>
      <body></body>
    </html>
</iframe>

The silent_renew.html which I suspect would be encapsulated in this iFrame, is put on an address accessable from postman and Chrome, and the entire URI is set to the silent_renew_url parameter.

The console doesn’t mention anything about silent_renew getting invoked before the access_token expires.

Sample app is attached.

Thanks. SilentRenew.zip

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jcfore21commented, May 9, 2018

Hey @damienbod , I was having a similar issue to @jonasbg because the iframe wasn’t actually pointing to the correct token renew url and server side we weren’t handling it correctly - IDS was giving back errors. @jonasbg you may want to check your Network tab in Chrome for request and look to see if its making a request for the silent-renew.html.

After fixing this issue im having a similar problem to @chazt3n. It appears that the iframe is reloading its src attribute every second which fires the ngOnInit() in my app.component. This component has some initial setup which calls lookup endpoints - so i’m seeing it making those requests over and over again.

I had set my silent_renew_offset_in_seconds setting to 300 - but the token expire time is 3600. Shouldn’t this mean it wont update the token for at least 3300 seconds? Why is it happening every second? Also - if I put that down to 10 seconds and it doesn’t seem to update every second anymore (however, I haven’t waited an hour to see if it does actually refresh though).

@damienbod any thoughts on this issue?

0reactions
jonasbgcommented, Jul 3, 2018

I got it to work, but I’m unsure of how. I think that I missed some silent-renew configs on the STS and setup.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to handle oidc silent renew error
I can log in, and I can see that silenRenew works as expected when the token expires. There is one problem though. If...
Read more >
Is access token silent renew supported? - Gluu Support
I am trying to do silent token renewal with oidc-client, using oidc authorization code flow on a React SPA. I expected silent access...
Read more >
Silent Refresh - Refreshing Access Tokens when using the ...
Here we have enabled silent refresh using the automaticSilentRenew property. This will cause an event to be fired close to when our access...
Read more >
Single-page application: Acquire a token to call an API
The pattern for acquiring tokens for APIs with MSAL.js is to first attempt a silent token request by using the acquireTokenSilent method.
Read more >
ASP.NET Core, C#, IdentityServer4, oidc-client - Silent Renew
Today we implement the ground work needed for silent refreshing of our tokens from our nuxtjs application using the oidc-client ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found