authorizationidentityserver4duende-identity-server

What are stored in PersistedGrant table for IdentityServer


I stored IdentityServer tables in SQL database. There is a table, PersistedGrants. When the type is "AuthorizationCode", which column that stores the Authorization Code? Is it the key in the table?


Solution

  • The table definition for that table is shown below. From that you see the primary key of the table in an integer.

    CREATE TABLE "PersistedGrants" (
        "Id" INTEGER NOT NULL CONSTRAINT "PK_PersistedGrants" PRIMARY KEY AUTOINCREMENT,
        "Key" TEXT NULL,
        "Type" TEXT NOT NULL,
        "SubjectId" TEXT NULL,
        "SessionId" TEXT NULL,
        "ClientId" TEXT NOT NULL,
        "Description" TEXT NULL,
        "CreationTime" TEXT NOT NULL,
        "Expiration" TEXT NULL,
        "ConsumedTime" TEXT NULL,
        "Data" TEXT NOT NULL
    );
    

    Then there is a index on the key field

    CREATE UNIQUE INDEX "IX_PersistedGrants_Key" ON "PersistedGrants" ("Key");
    

    Here is what the table can look like with sample data:

    enter image description here