mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Add trakt in the list of supported oidc
This commit is contained in:
parent
1cd3704bc3
commit
95bc5b9f7c
@ -41,7 +41,7 @@ THEMOVIEDB_APIKEY=
|
||||
# The url you can use to reach your kyoo instance. This is used during oidc to redirect users to your instance.
|
||||
PUBLIC_URL=http://localhost:5000
|
||||
|
||||
# Use a builtin oidc service (google, discord, or simkl):
|
||||
# Use a builtin oidc service (google, discord, trakt, or simkl):
|
||||
# When you create a client_id, secret combo you may be asked for a redirect url. You need to specify https://YOUR-PUBLIC-URL/api/auth/logged/YOUR-SERVICE-NAME
|
||||
OIDC_DISCORD_CLIENTID=
|
||||
OIDC_DISCORD_SECRET=
|
||||
|
@ -63,8 +63,12 @@ public class JwtProfile
|
||||
{
|
||||
if (value is null)
|
||||
return;
|
||||
// trakt store their name there (they also store name but that's not the same).
|
||||
Username ??= value["username"]?.ToString();
|
||||
// simkl store their name there.
|
||||
Username ??= value["name"]?.ToString();
|
||||
|
||||
Sub ??= value["ids"]?["uuid"]?.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -148,5 +148,19 @@ public class OidcProvider
|
||||
GetExtraHeaders = (OidcProvider self) =>
|
||||
new() { ["simkl-api-key"] = self.ClientId },
|
||||
},
|
||||
["trakt"] = new("trakt")
|
||||
{
|
||||
DisplayName = "Trakt",
|
||||
LogoUrl = "https://logo.clearbit.com/trakt.tv",
|
||||
AuthorizationUrl = "https://api.trakt.tv/oauth/authorize",
|
||||
TokenUrl = "https://api.trakt.tv/oauth/token",
|
||||
ProfileUrl = "https://api.trakt.tv/users/settings",
|
||||
// does not seems to have scopes
|
||||
Scope = null,
|
||||
TokenUseJsonBody = true,
|
||||
GetProfileUrl = (profile) => $"https://trakt.tv/users/{profile.Username}",
|
||||
GetExtraHeaders = (OidcProvider self) =>
|
||||
new() { ["trakt-api-key"] = self.ClientId, ["trakt-api-version"] = "2", },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user