[GH-ISSUE #3264] [Question] how to hardcode the token used by the authentication_method? #2619

Closed
opened 2026-05-05 13:41:19 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @abdeldjalil-fellah on GitHub (Jan 22, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3264

how to hardcode the token used by the authentication_method before building the client and the server?
does this token affect the login plugin?

frps

[common]
authentication_method = token
token = <hardcoded>

[plugin.auth]
addr = 127.0.0.1:9000
path = /auth
ops = Login

frpc

[common]
token = <hardcoded>
Originally created by @abdeldjalil-fellah on GitHub (Jan 22, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3264 how to **hardcode** the token used by the `authentication_method` before building the client and the server? does this token **affect** the login plugin? # frps [common] authentication_method = token token = <hardcoded> [plugin.auth] addr = 127.0.0.1:9000 path = /auth ops = Login # frpc [common] token = <hardcoded>
gitea-mirror 2026-05-05 13:41:19 -06:00
Author
Owner

@Becods commented on GitHub (Jan 23, 2023):

7678938c08/pkg/config/client_test.go (L240-L304)

7678938c08/pkg/config/client.go (L167-L195)

func GetDefaultClientConf() ClientCommonConf { 
	return ClientCommonConf{ 
		ClientConfig: auth.ClientConfig{ 
			BaseConfig: auth.BaseConfig{ 
				AuthenticationMethod:     "token"
			}, 
			TokenConfig: auth.TokenConfig{ 
				Token: "12345678", 
			}, 
		}, 
		ServerAddr:              "x.x.x.x", 
...

Maybe it will work, maybe it won't.

<!-- gh-comment-id:1400660104 --> @Becods commented on GitHub (Jan 23, 2023): https://github.com/fatedier/frp/blob/7678938c088c8d57367494ad53dd5c3b9e0cca35/pkg/config/client_test.go#L240-L304 https://github.com/fatedier/frp/blob/7678938c088c8d57367494ad53dd5c3b9e0cca35/pkg/config/client.go#L167-L195 ``` func GetDefaultClientConf() ClientCommonConf { return ClientCommonConf{ ClientConfig: auth.ClientConfig{ BaseConfig: auth.BaseConfig{ AuthenticationMethod: "token" }, TokenConfig: auth.TokenConfig{ Token: "12345678", }, }, ServerAddr: "x.x.x.x", ... ``` Maybe it will work, maybe it won't.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 23, 2023):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1441066269 --> @github-actions[bot] commented on GitHub (Feb 23, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#2619
No description provided.