mirror of https://github.com/Squidex/squidex.git
Browse Source
OpenIddict 7.4 persists the full token type identifiers instead of the
short names used by earlier versions. The longest of them,
"urn:openiddict:params:oauth:token-type:authorization_code", needs 57
characters, but the token type column only allows 50, because the pinned
Squidex.OpenIdDict.EntityFramework fork still declares the old length.
Every interactive login therefore failed when the authorization code was
stored, and the user was redirected to the error page:
Msg 2628: String or binary data would be truncated in table
'OpenIddictTokens', column 'Type'.
The client credentials flow was unaffected, because the access token
identifier still fits into 50 characters. MongoDB was unaffected as
well, because it does not enforce a length.
Widen the column to 150 characters, which is the length official
OpenIddict uses for the same reason, and add a migration for all three
relational providers. The new test compares the stored value instead of
only saving it, because MySql truncates silently outside of strict mode.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
pull/1329/head
11 changed files with 5070 additions and 9 deletions
File diff suppressed because it is too large
@ -0,0 +1,44 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Squidex.Providers.MySql.App.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class WidenOpenIddictTokenType : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Type", |
|||
table: "OpenIddictTokens", |
|||
type: "varchar(150)", |
|||
maxLength: 150, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Type", |
|||
table: "OpenIddictTokens", |
|||
type: "varchar(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "varchar(150)", |
|||
oldMaxLength: 150, |
|||
oldNullable: true) |
|||
.Annotation("MySql:CharSet", "utf8mb4") |
|||
.OldAnnotation("MySql:CharSet", "utf8mb4"); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,40 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Squidex.Providers.Postgres.App.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class WidenOpenIddictTokenType : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Type", |
|||
table: "OpenIddictTokens", |
|||
type: "character varying(150)", |
|||
maxLength: 150, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Type", |
|||
table: "OpenIddictTokens", |
|||
type: "character varying(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(150)", |
|||
oldMaxLength: 150, |
|||
oldNullable: true); |
|||
} |
|||
} |
|||
} |
|||
File diff suppressed because it is too large
@ -0,0 +1,40 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Squidex.Providers.SqlServer.App.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class WidenOpenIddictTokenType : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Type", |
|||
table: "OpenIddictTokens", |
|||
type: "nvarchar(150)", |
|||
maxLength: 150, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "Type", |
|||
table: "OpenIddictTokens", |
|||
type: "nvarchar(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(150)", |
|||
oldMaxLength: 150, |
|||
oldNullable: true); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue