Add discord as a builtin oidc provider

This commit is contained in:
Zoe Roux 2024-03-03 22:34:32 +01:00
parent 0d325f2c73
commit b3a341847e
2 changed files with 13 additions and 0 deletions

View File

@ -24,6 +24,10 @@ namespace Kyoo.Authentication.Models.DTO;
public class JwtProfile
{
public string Sub { get; set; }
public string Uid { set => Sub = value; }
public string Id { set => Sub = value; }
public string Guid { set => Sub = value; }
public string? Name { get; set; }
public string? Username { get; set; }
public string? Email { get; set; }

View File

@ -106,5 +106,14 @@ public class OidcProvider
ProfileUrl = "https://openidconnect.googleapis.com/v1/userinfo",
Scope = "email profile",
},
["discord"] = new("discord")
{
DisplayName = "Discord",
LogoUrl = "https://logo.clearbit.com/discord.com",
AuthorizationUrl = "https://discord.com/oauth2/authorize",
TokenUrl = "https://discord.com/api/oauth2/token",
ProfileUrl = "https://discord.com/api/users/@me",
Scope = "email+identify",
}
};
}