Comments (4)
SignInManager.SignOut expects there to be an external cookie registered as well which is where that signout call is coming, you can either override SignInManager's SignOut method here: https://github.com/aspnet/Identity/blob/master/src/Identity/SignInManager.cs#L206
Or you can add all of the identity cookies.
from identity.
@HaoK Thanks for the pointer, it looks like it fixed the exception. I was wondering why the SignOut
method was being called, and now that the exception is no longer an issue I'm simply redirected to the login screen. I guess the session was expiring and thus triggering the SignOut
method.
So, my next question is, why is it that my session is set for only 30 minutes? In the ConfigureApplicationCookie
I do set the ExpireTimeSpan
to four hours, so why is it being signed out earlier? Do I need to set the Cookie.Expiration
property too? I thought the ExpireTimeSpan
is the recommended property for controlling the lifetime of a cookie?
Thanks again!
from identity.
The security stamp validator runs every 30 minutes and that's probably invalidating your cookie, you can try removing the registration of that to see if that stops the behavior you are seeing
from identity.
@HaoK I figured it out! After your last comment I downloaded a copy of the solution and followed along the method calls to see where I was failing. After a few hours, it turned out that I, for whatever reason months ago, decided not to store a security stamp in the database. I guess I was being lazy since I was going to be the only user, not really sure? Anyway, once I added it in everything started working as I expected it to.
Thank you for pointing me in the right direction, I really appreciate it!
from identity.
Related Issues (20)
- Block enabling 2fa if cookie policy not accepted HOT 2
- Test failure: CheckPasswordSignInReturnsLockedOutWhenLockedOut HOT 16
- Test failure: PasswordSignInFailsWithWrongPassword HOT 7
- Question: can return an IIdentityBuilder interface instead of IdentityBuilder class? HOT 2
- Re-enable Identity tests on net461 HOT 1
- [Question] Passwords should not be of type String ? HOT 3
- Fix integrity tags on Identity UI V3 HOT 1
- Should IdentityUser be in the EntityFramework namespace? HOT 6
- AD directory user-groups; can IdentityRole be subclassed to implement Role-Groups or User-Groups HOT 6
- Survey: Your experience using Identity UI and customization HOT 1
- Spelling error DeletePersonalData.cshtml.cs HOT 2
- BypassTowFactor in SignInManager:ExternalLoginSignInAsync should default to False HOT 25
- Login doesn't show registered social logins after error HOT 1
- Remember me isPersistent understanding
- Replace a Role Validator HOT 2
- Random Authentication Sign Outs in ASP.NET Core 2.1 HOT 4
- Q: moving of source HOT 4
- No way to Add a password after creating user, except through Reset
- The non-scaffolded razor page "Register" does not recognise Password.RequiredLength. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from identity.