Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

Question: iFrame error login_required #98

Closed
chris-house opened this issue Aug 30, 2016 · 15 comments
Closed

Question: iFrame error login_required #98

chris-house opened this issue Aug 30, 2016 · 15 comments
Labels

Comments

@chris-house
Copy link

Hi, I have an iFrame auto-logging me in and auto refreshing the tokens, but somehow when I leave the website running overnight, I eventually get Response was error login_required.
image

Here is my login code. The main login function is startIframeLogin()

image

@chris-house
Copy link
Author

chris-house commented Aug 30, 2016

what I think is happening is the cookies on the Identity server are expired even though they are session cookies. To recreate, I can navigate to the identity server and delete the cookies. Then the signinSilent gets the error message. Do I first have to issue a signinRedirect when the page first loads before calling signinSilent?

@chris-house
Copy link
Author

Upon further analysis, it appears that IIS app pool is recycling every so often and the oidc server is storing some things in memory.

@brockallen
Copy link
Member

Yes, eventually the user will be logged out of the OP. IdSvr uses a fixed 8 hour cookie by default.

@chris-house
Copy link
Author

@brockallen , Do I first have to issue a signinRedirect when the page first loads before calling signinSilent? For me signinSilent is not creating the cookies on the identity server.

@brockallen
Copy link
Member

brockallen commented Aug 30, 2016

To create the cookie on IdSvr you need to send the user via the front channel to login.

@chris-house
Copy link
Author

chris-house commented Aug 30, 2016

@brockallen, I havent thought this through just yet, but couldn't the iframe call signinRedirect, process the callback. if I then call getUser and they exist, then just call mgr.signinSilentCallback?

these would happen in the signin_renew.html

On the main js file I would becalling mgr.signinSilent

My goal is to make my SPA autologin, and always stay loggedin.

@chris-house chris-house changed the title iFrame error login_required Question: iFrame error login_required Aug 30, 2016
@brockallen
Copy link
Member

My goal is to make my SPA autologin, and always stay loggedin.

This is fundamentally limited by the session lifetime at the OP (and then an access token lifetime).

@chris-house
Copy link
Author

@brockallen , yes but with the addAccessTokenExpiring and addAccessTokenExpired, we should be able to trigger the login proccess again.

@brockallen
Copy link
Member

The expiration of the access token is unrelated to the user's session at the OP. If they're still logged in at the OP, then yes, silent renew should just work. But if their session is ended at the OP, then there's nothing you can do except detect this and force them to go login again.

@chris-house
Copy link
Author

@brockallen could I implement the initial login through an iframe?

@chris-house chris-house reopened this Nov 9, 2016
@chris-house
Copy link
Author

To answer my own question: yes I can.

@ErikSchierboom
Copy link
Contributor

@crh225 Could you perhaps show how you solved this? I'm having the same problem.

@vaarenyam
Copy link

It would indeed be nice to get to know the resolution to this issue.

@jvitor83
Copy link

@brockallen You have said:

"But if their session is ended at the OP, then there's nothing you can do except detect this and force them to go login again"

There is anywhere in the Identity Server where i can configure this time?

@crh225 How did you solve this problem?

@coder8keyboard
Copy link

This is not a very good design. If user's session ends while in the middle of completing a long form, they will lose all the information that they filled in. Sounds like a major bug.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

6 participants