Git Product home page Git Product logo

macaroon-identity's Introduction

Sample macaroon-based identity service

Build status Go Report Card GoDoc

A sample identity service based on macaroon using the "form" authentication mechanism with user/password based on a CSV file.

It provides two binaries:

  • macaroon-identity: server providing form-based authentication with user/password
  • test-macaroon-identity: a sample executable which features a client connecting to a service which requires authentication through a third-party authentication service (which is effectively macaroon-identity).

NOTE: the macaroon-identity server is meant as a sample service and not intended for any production use.

Install

With a GOPATH set, run

go get -v github.com/albertodonato/macaroon-identity/...

Run tests

To run tests, first install test dependencies with:

 go get -v -t github.com/albertodonato/macaroon-identity/...

then

 go test github.com/albertodonato/macaroon-identity/...

Running

The server needs a CSV file containing credentials in the form username,password,groups.

The groups column is a space-separated list of groups that the user is part of and it's optional.

echo 'user1,pass2,grp1 grp2' > credentials.csv
$GOPATH/bin/macaroon-identity

By default the server endpoint is http://localhost:8081.

Testing a request

The test-macaroon-identity command starts the identity service and a test service which responds to GET / requests , requiring authentication through the identity service.

If -auth-username and -auth-password options are passed, the command also issues a request to the target service, to test the authentication process.

macaroon-identity's People

Contributors

albertodonato avatar

Watchers

James Cloos 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.