Skip to content

Conversation

@moooyo
Copy link

@moooyo moooyo commented Dec 17, 2025

  1. Add custom OIDC support for backend server.
  2. Add custom OIDC configuration form.

background:
Pocket ID is a self hosted OIDC provider which can easily provide the passkey login ability.

login page:
image

Click Login with Pocket ID
image

Oauth configuration page:
image

form:
image
image

Tested in my local env, everything works well.

demo:

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds custom OIDC (OpenID Connect) provider support to enable authentication with self-hosted identity providers like Pocket ID, Keycloak, Authentik, and Authelia. The implementation includes both frontend UI components for configuration and backend API handlers for OIDC discovery and authentication flows.

  • Adds "custom" as a third OAuth provider option alongside existing GitHub and Cloudflare support
  • Implements OIDC discovery endpoint to auto-populate configuration from well-known URLs
  • Extends login page and security settings UI to support custom OIDC configuration with customizable display names

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 14 comments.

File Description
web/src/pages/login/index.tsx Adds custom OIDC login button with configurable display name on the login page
web/src/components/settings/security-settings.tsx Implements comprehensive custom OIDC configuration form with discovery functionality and validation
internal/api/auth.go Adds backend handlers for OIDC discovery, custom OIDC authentication flow, and token exchange with userinfo extraction

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 14 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 12 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

c.JSON(http.StatusBadGateway, gin.H{"error": "读取 OIDC Token 响应失败"})
return
}
fmt.Printf("🔑 Custom OIDC Token 响应: %s\n", string(body))
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The complete token response (which may contain sensitive information like access tokens or id tokens) is logged to stdout. This could expose credentials in log files. Consider logging only metadata like status codes or redacting sensitive fields from the logged response.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

@moooyo
Copy link
Author

moooyo commented Dec 18, 2025

Ok, for my opinion, only admin can control the Oauth setting, so we don't need to consider the attach issue

@moooyo
Copy link
Author

moooyo commented Dec 18, 2025

@Mecozea Could you please give some suggestion?

@Mecozea
Copy link
Collaborator

Mecozea commented Dec 18, 2025

@Mecozea Could you please give some suggestion?

well, in my opinion, the current design of this part is quite good. However, in my plan, oauth2 is already sufficient for personal use. But if you insist on adding OIDC support, I will add it, but it might still take some time because I've been a bit busy recently.

Thank you for your attention and contribution. and please wait for a few days

and by the way ,the next version will support i18n.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants