package service

Import Path
	github.com/jcmturner/gokrb5/v8/service (on go.dev)

Dependency Relation
	imports 15 packages, and imported by one package

Involved Source Files APExchange.go authenticator.go Package service provides server side integrations for Kerberos authentication. settings.go
Package-Level Type Names (total 4)
/* sort by: | */
Cache for tickets received from clients keyed by fully qualified client name. Used to track replay of tickets. AddEntry adds an entry to the Cache. ClearOldEntries clears entries from the Cache that are older than the duration provided. IsReplay tests if the Authenticator provided is a replay within the duration defined. If this is not a replay add the entry to the cache for tracking. func GetReplayCache(d time.Duration) *Cache
KRB5BasicAuthenticator implements gokrb5.com/jcmturner/goidentity.Authenticator interface. It takes username and password so can be used for basic authentication. BasicHeaderValue string Authenticate and return the identity. The boolean indicates if the authentication was successful. Mechanism returns the authentication mechanism. KRB5BasicAuthenticator : github.com/jcmturner/goidentity/v6.Authenticator func NewKRB5BasicAuthenticator(headerVal string, krb5conf *config.Config, serviceSettings *Settings, clientSettings *client.Settings) KRB5BasicAuthenticator
SessionMgr must provide a ways to: - Create new sessions and in the process add a value to the session under the key provided. - Get an existing session returning the value in the session under the key provided. Return nil bytes and/or error if there is no session. ( SessionMgr) Get(r *http.Request, k string) ([]byte, error) ( SessionMgr) New(w http.ResponseWriter, r *http.Request, k string, v []byte) error func (*Settings).SessionManager() SessionMgr func SessionManager(sm SessionMgr) func(*Settings)
Settings defines service side configuration settings. Keytab *keytab.Keytab ClientAddress returns the client host address which has been provided to the service. DecodePAC indicates whether the service should decode any PAC information present in the ticket. KeytabPrincipal returns the principal name used to find the key in the keytab if it has been overridden. Logger returns the logger instances configured for the service. If none is configured nill will be returned. MaxClockSkew returns the maximum acceptable clock skew between the service and the issue time of kerberos tickets. If none is defined a duration of 5 minutes is returned. RequireHostAddr indicates if the service should require the host address to be included in the ticket. SName returns the specific service name to the service. SessionManager returns any configured session manager. func NewSettings(kt *keytab.Keytab, settings ...func(*Settings)) *Settings func NewKRB5BasicAuthenticator(headerVal string, krb5conf *config.Config, serviceSettings *Settings, clientSettings *client.Settings) KRB5BasicAuthenticator func VerifyAPREQ(APReq *messages.APReq, s *Settings) (bool, *credentials.Credentials, error)
Package-Level Functions (total 12)
ClientAddress used to configure service side with the clients host address to be used during validation. s := NewSettings(kt, ClientAddress(h))
DecodePAC used to configure service side to enable/disable PAC decoding if the PAC is present. Defaults to enabled if not specified. s := NewSettings(kt, DecodePAC(false))
GetReplayCache returns a pointer to the Cache singleton.
KeytabPrincipal used to override the principal name used to find the key in the keytab. s := NewSettings(kt, KeytabPrincipal("someaccount"))
Logger used to configure service side with a logger. s := NewSettings(kt, Logger(l))
MaxClockSkew used to configure service side with the maximum acceptable clock skew between the service and the issue time of kerberos tickets s := NewSettings(kt, MaxClockSkew(d))
NewKRB5BasicAuthenticator creates a new NewKRB5BasicAuthenticator
NewSettings creates a new service Settings.
RequireHostAddr used to configure service side to required host addresses to be specified in Kerberos tickets. s := NewSettings(kt, RequireHostAddr(true))
SessionManager configures a session manager to establish sessions with clients to avoid excessive authentication challenges. s := NewSettings(kt, SessionManager(sm))
SName used provide a specific service name to the service settings. s := NewSettings(kt, SName("HTTP/some.service.com"))
VerifyAPREQ verifies an AP_REQ sent to the service. Returns a boolean for if the AP_REQ is valid and the client's principal name and realm.