feat: add some fediverse authentication code

* create applications on instances
* generate authorize URLs
* exchange oauth code for token and user info (untested)
* recreate mastodon app on authentication failure
This commit is contained in:
sam 2024-10-06 15:34:31 +02:00
parent a4ca0902a3
commit 0077a165b5
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
8 changed files with 497 additions and 0 deletions

View file

@ -107,6 +107,10 @@ namespace Foxnouns.Backend.Database.Migrations
.HasColumnType("bigint")
.HasColumnName("id");
b.Property<string>("AccessToken")
.HasColumnType("text")
.HasColumnName("access_token");
b.Property<string>("ClientId")
.IsRequired()
.HasColumnType("text")
@ -126,6 +130,10 @@ namespace Foxnouns.Backend.Database.Migrations
.HasColumnType("integer")
.HasColumnName("instance_type");
b.Property<Instant?>("TokenValidUntil")
.HasColumnType("timestamp with time zone")
.HasColumnName("token_valid_until");
b.HasKey("Id")
.HasName("pk_fediverse_applications");