Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,13 @@ public ValueTask HandleAsync(ProcessAuthenticationContext context)
context.TokenRequest.UserCode = code;
}

// osu! requires the "public" scope for client credentials grant, as tokens without scopes are invalid.
else if (context.GrantType is GrantTypes.ClientCredentials &&
context.Registration.ProviderType is ProviderTypes.Osu)
{
context.TokenRequest.Scope = "public";
}

// VK ID requires attaching a non-standard "device_id" parameter to all token requests.
//
// This parameter is either resolved from the authorization response (for the authorization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1747,6 +1747,35 @@
ConfigurationEndpoint="https://api.orange.com/openidconnect/fr/v1/.well-known/openid-configuration" />
</Provider>

<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄▄ ██ ▄▄▄ ██ ██ ██ ██
██ ███ ██▄▄▄▀▀██ ██ ██ ██
██ ▀▀▀ ██ ▀▀▀ ██▄▀▀▄██▀██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->

<Provider Name="Osu" DisplayName="osu!" Id="924114e6-6334-4124-bbf9-46cd5458da25"
Documentation="https://osu.ppy.sh/docs/index.html#client-credentials-grant">
<Environment Issuer="https://osu.ppy.sh/">
<Configuration AuthorizationEndpoint="https://osu.ppy.sh/oauth/authorize"
TokenEndpoint="https://osu.ppy.sh/oauth/token"
UserInfoEndpoint="{(string.IsNullOrEmpty(settings.GameMode) ? 'https://osu.ppy.sh/api/v2/me' : $'https://osu.ppy.sh/api/v2/me/{settings.GameMode}')}">
<GrantType Value="authorization_code" />
<GrantType Value="client_credentials" />
<GrantType Value="refresh_token" />
</Configuration>
</Environment>

<Constant Class="GameModes" Value="osu" Name="Standard" />
<Constant Class="GameModes" Value="taiko" Name="Taiko" />
<Constant Class="GameModes" Value="fruits" Name="Fruits" />
<Constant Class="GameModes" Value="mania" Name="Mania" />

<Setting PropertyName="GameMode" ParameterName="mode" Type="String" Required="false"
Description="The game mode to retrieve statistics for (e.g., 'osu', 'taiko', 'fruits', 'mania'). User default mode will be used if not specified." />
</Provider>

<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄ █ ▄▄▀█▄▄ ▄▄██ ▄▄▀██ ▄▄▄██ ▄▄▄ ██ ▀██ ██
Expand Down