0

I had indetity server4 and I had to add session management. I upgrated the application version to duende identityserver 6.2. And created a database based on PersistedGrantDbContext and ConfigurationDbContext. enter image description here

my database asp .NET core identity Users enter image description here

my configurations enter image description here

Now I get a token using connect/token and the token is valid. But now sessions are not saved to the ServerSideSessions and Devices table in the DeviceCodes table.

How do me added saving sissions and devices in my database? To add management using interface ISessionManagementService? Thanks in advance for the answers!

  • Welcome to Stackoverflow. Please add codes as text (instead on images) in the questions/answers please read [this](https://stackoverflow.com/help/formatting) – MD Zand Dec 22 '22 at 16:26
  • What flow are you trying to use? authorization code flow or device flow? – Tore Nestenius Dec 23 '22 at 09:21
  • I hope that you added this extension method on startup/program `.AddServerSideSessions()` – Jay Feb 09 '23 at 15:52

1 Answers1

0

I advise you to implement your session management logic. Step 1 Create a UserSessions table, then when the user gets an accessToken save the session to that table. Step 2 When you need to delete a session, you give the records from the PersistedGrants table and delete the corresponding sessions. But there is one drawback to this implementation: A user's session will only die when their accessToken expires.