Giter Club home page Giter Club logo

auth-go's Introduction

Go Oauth2 Helper Module

Canonical source at https://github.com/rwxrob/auth-go

Oauth2 Session

GoDoc License Go Report Card Coverage

Designed to help make command line Oauth2 easier to implement and use from shell scripts and other command line utilities.

Example Usage

Main

auth <name>
auth token <name>
auth grant <name>
auth refresh <name>
auth help

Create, Replace, Update, Delete (CRUD)

auth add
auth rm <name>
auth edit
auth export <file> [<name> ...]
auth import <file> [<name> ...]

View / Output

auth ls
auth conf 
auth json <name>
auth get access <name>
auth get refresh <name>
auth get type <name>
auth get expiry <name>
auth get state <name>
auth get code <name>
auth get id <name>
auth get secret <name>
auth get scopes <name>
auth get redirecturl <name>
auth get authurl <name>
auth get tokenurl <name>
auth get style <name>

Embed

curl -H "Authorization: Bearer $(auth <name>)" https://api.example.com/some

The auth command can be used in place of sensitive token and other credential information within shell scripts. By default, the user will be prompted when further authorization flow steps are needed, including the opening of a local graphical web browser automatically. The level of interaction can be isolated for scripts that must run without blocking on waits for interactivity.

Unlike many other authorization solutions, auth starts a local web server to handle the redirection and safely intercept the token that was upgraded from the authorization code. Other tools generally prompt for this to be cut and pasted in. If the opening of the web browser fails, a prompt is shown instead.

TODO

  • Add Oauth 1.0a support (twitter)
  • Add token revocation
  • As much test coverage as we can achieve without a mock token server
  • Add some detection of changes to the file since opened so don't overwrite with currently running process with the cache open (like vi)

auth-go's People

Contributors

rwxrob avatar

Watchers

 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.