add basic suppport for client_credentials oauth grant
This commit is contained in:
parent
049f4a56de
commit
8995213d26
20 changed files with 627 additions and 58 deletions
|
@ -0,0 +1,71 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Foxchat.Identity.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddRedirectUris : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_tokens_accounts_account_id",
|
||||
table: "tokens");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "account_id",
|
||||
table: "tokens",
|
||||
type: "uuid",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uuid");
|
||||
|
||||
migrationBuilder.AddColumn<string[]>(
|
||||
name: "redirect_uris",
|
||||
table: "applications",
|
||||
type: "text[]",
|
||||
nullable: false,
|
||||
defaultValue: new string[0]);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_tokens_accounts_account_id",
|
||||
table: "tokens",
|
||||
column: "account_id",
|
||||
principalTable: "accounts",
|
||||
principalColumn: "id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "fk_tokens_accounts_account_id",
|
||||
table: "tokens");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "redirect_uris",
|
||||
table: "applications");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "account_id",
|
||||
table: "tokens",
|
||||
type: "uuid",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uuid",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "fk_tokens_accounts_account_id",
|
||||
table: "tokens",
|
||||
column: "account_id",
|
||||
principalTable: "accounts",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue