Add osu! OAuth 2.0 provider integration#1
Conversation
Co-authored-by: gehongyan <21241496+gehongyan@users.noreply.github.com>
|
@copilot authorization_code 和 refresh_token 的控制台测试通过了,但是 client_credentials 模式在调试输出报错 OpenIddict.Client.OpenIddictClientDispatcher: Information: The token request was rejected by the remote authorization server: { 文档中提到,此模式下,scope Must be public; other scopes have no meaningful effect. 另外: |
…ve defaults Co-authored-by: gehongyan <21241496+gehongyan@users.noreply.github.com>
Fixed in commit 3c626e3:
The handler automatically sets Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot 很好,两种认证方式都正常工作了,但是需要注意,项目有严谨的编码风格,各处理方法中对不同服务提供商的处理需要按照 ProviderTypes 字典序排序,你需要ti调整你所插入代码的位置。 |
Co-authored-by: gehongyan <21241496+gehongyan@users.noreply.github.com>
Fixed in commit 6087c45. The osu! handlers are now properly ordered alphabetically by ProviderTypes:
|
|
@copilot XML 中各个服务提供商的 Banner 是用 Unicode 块状元素组合出的服务名称,目前你所组合的 Banner 不正确,再试一下 |
Co-authored-by: gehongyan <21241496+gehongyan@users.noreply.github.com>
Fixed in commit 61ffd37. The ASCII art banner now correctly spells "OSU!" using Unicode block elements: Breaking down: O (circle) + S (snake) + U (U-shape) + ! (exclamation) |
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml
Outdated
Show resolved
Hide resolved
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml
Outdated
Show resolved
Hide resolved
Co-authored-by: gehongyan <21241496+gehongyan@users.noreply.github.com>
|
@copilot 游戏模式是路径参数而非请求体或表单参数,你可以直接在 XML 中参照其他以 C# 模板字符串方式引用用户设置的参数值,修正用户信息请求路径。 |
Co-authored-by: gehongyan <21241496+gehongyan@users.noreply.github.com>
Fixed in commit 5cd2ac4. The mode is now a path parameter in the UserInfo endpoint URL using a C# conditional expression: |
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml
Outdated
Show resolved
Hide resolved
Co-authored-by: gehongyan <21241496+gehongyan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds OAuth 2.0 provider integration for osu!, a popular rhythm game platform. The implementation includes provider configuration in XML with support for game mode-specific user info retrieval and a custom handler to automatically set the "public" scope for client credentials grants.
Key changes:
- Added osu! provider entry with OAuth 2.0 endpoints (authorization, token, userinfo)
- Implemented game mode parameter support for retrieving mode-specific user statistics
- Added handler to automatically set "public" scope for client_credentials grant
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml | Adds osu! provider configuration with OAuth 2.0 endpoints, game mode constants (Standard, Taiko, Fruits, Mania), conditional UserInfo endpoint logic, and ASCII art banner |
| src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs | Adds handler logic to automatically set "public" scope for client_credentials grant requests, positioned alphabetically between Amazon and VkId handlers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Changes Made
Provider Configuration (XML):
{(string.IsNullOrEmpty(settings.GameMode) ? 'https://osu.ppy.sh/api/v2/me' : $'https://osu.ppy.sh/api/v2/me/{settings.GameMode}')}Handler Implementations (C#):
Code Style:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.