Documentation ¶
Overview ¶
Package goradius implements basic Radius client capabilities, allowing Go code to authenticate against a Radius server. It is based on https://github.com/btimby/py-radius Python package
Index ¶
Constants ¶
const ( // AccessRequest packet id AccessRequest = iota + 1 // AccessAccept packet id AccessAccept // AccessReject packet id AccessReject // RETRIES is the number of login retries RETRIES = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthenticatorT ¶
type AuthenticatorT struct {
// contains filtered or unexported fields
}
The AuthenticatorT object implements the Authenticate method to check whether a user can authenticate against the provided server
func Authenticator ¶
func Authenticator(server, port, secret string) *AuthenticatorT
Authenticator method returns a new AuthenticatorT object, providing the server url and port and the secret associated to the client (registered on the server).
func AuthenticatorWithTimeout ¶
func AuthenticatorWithTimeout(server, port, secret string, timeout time.Duration) *AuthenticatorT
AuthenticatorWithTimeout method returns a new AuthenticatorT object, providing the server url, the port, the secret and a timeout associated to the client (registered on the server).
func (*AuthenticatorT) Authenticate ¶
func (a *AuthenticatorT) Authenticate(username, password, nasID string) (bool, error)
Authenticate authenticates a user against the Radius server and returns true whether the user provided the correct password If nasId is empty this attribute won't be included in request.