OIDC-TOKEN(1)
π oidc-token β the bestie that fetches your OIDC access tokens π
okay so real talk, oidc-token is a User Command from the oidc-agent fam, and it is literally your little token-fetching sidekick. It goes and gets you OIDC access tokens from oidc-agent and hands them over. no cap.
β¨ SYNOPSIS β¨
oidc-token [OPTION...] ACCOUNT_SHORTNAME | ISSUER_URL
like. you give it an account shortname or an issuer URL, and you can sprinkle options on top. that's the whole vibe. π¦
πΈ DESCRIPTION πΈ
oidc-token β a client for oidc-agent for getting OIDC access tokens. she's giving "middleman but make it cute". here's everything she can do, grouped all nicely:
π General
--auth-header,--authβ returns the token but wrapped up inside an http authorization header, so it's ready to use with stuff likecurlorhttpie. plug and play, periodt.-a,--allβ returns all the available info: the token, the issuer, and the expiration time. each value gets its own line. one value per line, no chaos. β¨--bearerβ returns the token in bearer format, which is the format that works as the value for an http authorization header. it's giving "header-ready".-c,--envβ this one gets all the available info (same as-a), but instead of just printing it, it prints shell commands that export environment variables (with the default names). the result is literally the same as runningoidc-token -o -i -e. and if you want to rename each env var, the-o,-iand-eoptions let you do exactly that. slay.-e,--expires-at[=OIDC_EXP]β returns the expiration time for the access token you asked for. here's the tea: if neither-inor-ois set and you didn't passOIDC_EXP, the expiration time just gets printed to stdout. otherwise, shell commands get printed that export the value into an environment variable. and yes, you can name that variable withOIDC_EXP. π-f,--force-newβ forces a brand new access token to be issued and returned. no reusing, we're getting a fresh one bestie.-i,--issuer[=OIDC_ISS]β returns the issuer associated with the access token you requested. if neither-enor-ois set and you didn't passOIDC_ISS, the issuer gets printed to stdout. otherwise shell commands get printed that export the value into an environment variable. name it withOIDC_ISS. π-o,--token[=OIDC_AT]β returns the access token you asked for. if neither-inor-eis set and you didn't passOIDC_AT, the token gets printed to stdout (which is the exact same behaviour as not passing this option at all, iykyk). otherwise shell commands get printed that export the value into an environment variable. and the name of that variable can be set withOIDC_AT.-t,--time=SECONDSβ minimum number of seconds the access token should still be valid for. she checks the freshness. β
π₯ Advanced
--aud=AUDIENCEβ the audience for the access token you're requesting. you can provide multiple audiences as a space separated list. go off.--id-tokenβ returns an id-token instead of an access token. > β οΈ heads up bestie: this option is meant as a development tool. ID-tokens should not be passed as authorization to resources. not the move, okay? π-m,--mytoken[=PROFILE],--MT[=PROFILE]β returns a mytoken instead of an access token. to specify the properties of the issued mytoken, pass a mytoken profile. > π¨ important: this option can only be used with account shortnames, not with issuer urls. no exceptions, fr fr.--name=NAMEβ this one is for other applications / scripts that calloidc-tokento obtain an access token.NAMEis the name of that application, and it might get displayed to the user. so like, introduce yourself properly. π-s,--scope=SCOPEβ the scope to be requested for the access token. you can provide multiple scopes as a space separated list, or by using the option multiple times. both? both. π«Ά
π§ Help
-?,--helpβ give this help list. she's helping!--usageβ give a short usage message. the tl;dr version.-V,--versionβ print program version. π
π‘ little note that matters: mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options. so like, the rules carry over, okay?
π FILES π
oidc-token does not read or write any files. she's low maintenance. nothing on disk, no mess, iconic. β¨
π EXAMPLES π
okay these are the actual moves, copy them exactly bestie:
oidc-token example
Gets an access token for the 'example' account configuration.
oidc-token example -t 60
Gets an access token for the 'example' account configuration which will be valid for at least 60 seconds.
oidc-token example -i
Gets the issuer url associated to the requested access token.
oidc-token example -a
Gets an access token, the associated issuer url, and the expiration date of the token. One information per line.
eval `oidc-token example -c`
Sets environment variables with the access token, the associated issuer url, and the expiration date of the token.
oidc-token example --scope=openid --scope=profile
Gets an access token for the 'example' account configuration which will be only valid for the 'openid' and 'profile' scope.
π REPORTING BUGS π
found a bug? don't suffer in silence, tell the devs:
Report bugs to <https://github.com/indigo-dc/oidc-agent/issues>
Subscribe to our mailing list to receive important updates about oidc-agent: <https://www.lists.kit.edu/sympa/subscribe/oidc-agent-user>.
π SEE ALSO π
Low-traffic mailing list with updates such as critical security incidents and new releases: https://www.lists.kit.edu/sympa/subscribe/oidc-agent-user
Full documentation can be found at https://indigo-dc.github.io/oidc-agent/usage/oidc-token/
and that's the whole page, bestie π this one's oidc-token version 5.3.8, dated September 2026 β go forth and fetch those tokens, you absolute main character. πβ¨π¦
π¦ where this page comes from
- epel 10: oidc-agent-cli 5.3.8-1.el10_3 Β· MIT AND ISC AND LGPL-2.1-or-later AND BSD-2-Clause
- fedora 43: oidc-agent-cli 5.3.8-1.fc43 Β· MIT AND ISC AND LGPL-2.1-or-later AND BSD-2-Clause
- fedora 44: oidc-agent-cli 5.3.8-1.fc44 Β· MIT AND ISC AND LGPL-2.1-or-later AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms