frp supports two main authentication methods. You must configure auth.method in both frpc.toml and frps.toml.
Token Authentication
Set auth.method = "token". Both sides must share the same auth.token.
File-based token source:
You can read the token from a file instead of hardcoding it:
# frpc.toml
auth.method = "token"
auth.tokenSource.type = "file"
auth.tokenSource.file.path = "/path/to/token/file"
OIDC Authentication
Set auth.method = "oidc". This uses the Client Credentials Grant flow.
Server configuration (frps.toml):
auth.method = "oidc"
auth.oidc.issuer = "https://example-oidc-issuer.com/"
auth.oidc.audience = "https://oidc-audience.com/.default"
Client configuration (frpc.toml):
auth.method = "oidc"
auth.oidc.clientID = "YOUR_CLIENT_ID"
auth.oidc.clientSecret = "oidc_secret"
auth.oidc.audience = "https://oidc-audience.com/.default"
auth.oidc.tokenEndpointURL = "https://example-oidc-endpoint.com/oauth2/v2.0/token"