[GH-ISSUE #1406] Make authentication system customizable through server plugins #1109

Closed
opened 2026-05-05 12:42:51 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @velovix on GitHub (Aug 24, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1406

Edit: This behavior is expected to be implemented using server plugins. This issue is re-purposed as a feature request to allow this customization using server plugins.

Original Proposal

I'm integrating FRP into a larger system with a pre-existing authentication mechanism. It would be great if I could customize the way FRP generates and checks privilege keys by, for example, providing callback functions. Perhaps it could look like this:

// client/service.go
func (svr *Service) SetKeyGenerator(generator func() string) {
    svr.keyGenerator = generator
}
// server/service.go
func (svr *Service) SetKeyChecker(keyChecker func(privilegeKey string) bool) {
    svr.keyChecker = keyChecker
}

If these methods are not called, the client and server fall back to using the current key generation and checking system.

This feature would be exposed only through the library. I imagine that custom authentication is out of the scope of FRP when used as a command line tool.

If this looks good, I would be happy to send a pull request to implement this.

Originally created by @velovix on GitHub (Aug 24, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1406 Edit: This behavior is expected to be implemented using server plugins. This issue is re-purposed as a feature request to allow this customization using server plugins. # Original Proposal I'm integrating FRP into a larger system with a pre-existing authentication mechanism. It would be great if I could customize the way FRP generates and checks privilege keys by, for example, providing callback functions. Perhaps it could look like this: ```go // client/service.go func (svr *Service) SetKeyGenerator(generator func() string) { svr.keyGenerator = generator } ``` ```go // server/service.go func (svr *Service) SetKeyChecker(keyChecker func(privilegeKey string) bool) { svr.keyChecker = keyChecker } ``` If these methods are not called, the client and server fall back to using the current key generation and checking system. This feature would be exposed only through the library. I imagine that custom authentication is out of the scope of FRP when used as a command line tool. If this looks good, I would be happy to send a pull request to implement this.
Author
Owner

@fatedier commented on GitHub (Aug 25, 2019):

I want to expose some features by server plugin, you can see #1378 and #1403.

Not only the token or privilegeKey need to check, but also the user or other meta info. We should implement this in a general method.

The plugin feature need detailed design and will not be provided soon.

<!-- gh-comment-id:524596439 --> @fatedier commented on GitHub (Aug 25, 2019): I want to expose some features by `server plugin`, you can see #1378 and #1403. Not only the `token or privilegeKey` need to check, but also the `user` or other meta info. We should implement this in a general method. The `plugin` feature need detailed design and will not be provided soon.
Author
Owner

@velovix commented on GitHub (Aug 26, 2019):

Okay, sounds good. If it's okay, I will re-purpose this issue to track allowing this kind of customization through server plugins.

<!-- gh-comment-id:524964549 --> @velovix commented on GitHub (Aug 26, 2019): Okay, sounds good. If it's okay, I will re-purpose this issue to track allowing this kind of customization through server plugins.
Author
Owner

@fatedier commented on GitHub (Jan 5, 2020):

v0.31.0 support server manage plugin.

<!-- gh-comment-id:570853960 --> @fatedier commented on GitHub (Jan 5, 2020): v0.31.0 support server manage plugin.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#1109
No description provided.