Skip to content

kofoworola/oauthcli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAuthCLI

Features

Build Status

oauthcli is a command line tool for generating access tokens for diferent oauth grant types via the command line. It allows you to carry out OAuth authentication requests on the following grant_types:

Installation

From Source

Currently, since it is written in go, you can only install it with

go install github.com/kofoworola/oauthcli

This installs it to the bin folder of your $GOPATH env variable, which should be a part of your $PATH variable by default. If it isn't then be sure to add it and restart your terminal.

Usage

Commands

Run oauthcli --help to see a list of commands and their parameters. Make sure to run oauthcli help <command> for more info on a specific command

usage: oauthcli --client-id=CLIENT-ID --scopes=SCOPES [<flags>] <command> [<args> ...]

Flags:
  --help                 Show context-sensitive help (also try --help-long and --help-man).
  --client-id=CLIENT-ID  The client ID to be used in getting the access_token.
  --client-secret=""     The client Secret to be used in the getting the access_token
  --scopes=SCOPES        The requested scopes
  --extra=EXTRA ...      Extra params to be sent along with the client_id during authentication request

Commands:
  help [<command>...]
    Show help.

  authcode [<flags>] <auth_url> [<token_url>]
    Perform an authorization_code grant flow; https://oauth.net/2/grant-types/authorization-code/

  client_credentials <auth_url>
    Perform client_credential grant flow; https://oauth.net/2/grant-types/client-credentials/

  implicit [<flags>] <auth_url>
    Perform (Legacy) implicit grant type; https://oauth.net/2/grant-types/implicit/

  password --username=USERNAME [<flags>] <auth_url>
    Perform (Legacy) password grant type; https://oauth.net/2/grant-types/password/

Dealing with callbacks

Since grant flows like auth_code and implicit involves the a redirect to a callback URL, you would need to enter the URL redirected to during the callback to the CLI, at which point, an access_token can be exctracted.

redirect link

TODO

  • Using refresh tokens.
  • Adding device grant flow.
  • Bug fixes as they come up.

About

Cli client for different oauth flows

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages