go-token-generator

command module
v0.0.0-...-a0c31bf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 10, 2020 License: MIT Imports: 9 Imported by: 0

README

Token Generator

This application generates tokens to authenticate the client on an API Call, granted the logic described in this article is implemented on server-side: https://apifriends.com/api-security/api-keys/

The big picture

Assuming the network traffic can be observed, we should consider that a single key is not a trustworthy credential that will guarantee the identity of the caller. A way to solve this problem is to share a secret on both sides and to "hide" this secret inside a token the client provides to the server alongside the request. When processing the request, the server will first challenge the token by checking if it was indeed generated using the shared secret. If the token doesn't pass that challenge, the request gets rejected.

Generate a token

Granted you have a valid key + secret couple, you'll generate a valid token like this:

token-generator -key <your key> -secret <your secret>

The program will display the token and clip it in your clipboard to be easily pasted in your favorite client.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL