https://github.com/xtfly/gokrb
A go wrapper for Kerberos
https://github.com/xtfly/gokrb
golang gssapi kerberos
Last synced: 6 months ago
JSON representation
A go wrapper for Kerberos
- Host: GitHub
- URL: https://github.com/xtfly/gokrb
- Owner: xtfly
- License: mit
- Created: 2017-05-03T14:14:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-12T13:23:57.000Z (about 9 years ago)
- Last Synced: 2024-06-20T16:39:40.842Z (about 2 years ago)
- Topics: golang, gssapi, kerberos
- Language: Go
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GoKrb
A go wrapper for Kerberos and SASL2 libs.
Currently the implemention:
- Client side APIs that use SASL APIs for authentication to service that implement GSSAPI using Kerberos 5.
Note: It is developing...
# Usage
Note: You need to install the krb5-libs, sasl2-libs, gcc into your OS,
like this in Archlinux:
$ sudo pacman -S krb5
$ sudo pacman -S gcc
Install this package using go tools:
$ go get github.com/xtfly/gokrb
To run you must have a valid Kerberos setup on the run machine
and you should ensure that you have valid Kerberos tickets:
$ export KRB5_CONFIG=/path/to/krb5.conf
$ kinit -kt "/path/to/your.keytab" "kafka/hadoop.com@HADOOP.COM"
$ klist
Example Kerberos client authentication to service:
package main
import (
"github.com/xtfly/gokrb/gssapi"
)
func main() {
var conn io.ReadWriter
//...
// create a connection to service
err := gssapi.GssAuth(conn, "kafka", "hadoop.com")
if err != nil {
// do something ...
}
}
Note: if the krb5-libs/sasl2-libs are not install in /usr/lib64 and /usr/include, you need set follow environment variables:
$ export CGO_CFLAG=-I/path/to/include
$ export CGO_LDFLAG=-L/path/to/lib
$ export LD_LIBRARY_PATH=/path/to/lib
# License
Gorkb is released under the MIT License. See the LICENSE file.