Giter Site home page Giter Site logo

gokrb's Introduction

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/[email protected]"
$ 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.

gokrb's People

Contributors

xtfly avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.