8000 GitHub - jwp003/oidc-token: Small program to make oidc/oauth2 authentication easier from CLI clients
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jwp003/oidc-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OIDC Token

A utility for receiving oauth2 access tokens from OIDC providers.

Build

go build

Copy the binary to your $PATH.

Usage

Create a config file at ~/.config/oidc-token/config.toml. This file will contain OIDC provider configurations. For example:

ListenAddress = "localhost:8888"

[[Providers]]
Name = "example"
URL = "https://auth.example.com"
ClientID = "example-client"
ClientSecret = "example-secret"
Scopes = ["openid", "profile", "email"]

[[Providers]]
Name = "another"
# ...

The ListenAddress controls the address on which oidc-token listens for an oauth callback. It should be a free local address:port.

After that is a list of providers. The Name is just an alias which is used when running the utility. The other values are the OIDC parameters.

With the config file in place, you can run it like this:

oidc-token example

This will open a browser for you to login, and once the flow is complete, print the oauth2 access token to stdout.

Use with cURL or other utilities like this:

curl -H "Authorization: Bearer $(oidc-token example)" 'https://exmaple.com'

About

Small program to make oidc/oauth2 authentication easier from CLI clients

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0