A command line tool for working with OIDC
From source with cargo:
cargo install oidc-cliA binary with cargo-binstall:
cargo binstall oidc-cliDownload a released binary: https://github.com/ctron/oidc-cli/releases
On Windows, you can use winget:
winget install ctron.oidcWith brew to you can:
brew tap ctron/tap
brew install ctron/tap/oidcCreating a new (confidential) client:
oidc create confidential my-client --issuer https://example.com/realm --client-id foo --client-secret barCreating a new (public) client:
oidc create public my-client --issuer https://example.com/realm --client-id fooThen, get an access token:
oidc token my-clientOr combine it with e.g., HTTPie:
http example.com/api "Authorization:$(oidc token my-client --bearer)"Or even shorter:
http example.com/api $(oidc token -H my-client)Create a public client from an initial refresh token. This can be useful if you have a frontend application, but no means of performing the authorization code flow with a local server. In case you have access to the refresh token, e.g via the browsers developer console, you can initialize the public client with that:
oidc create public my-client --issuer https://example.com/realm --client-id foo --refresh-token <refresh-token>