oidc-agent
  • Introduction
  • Quickstart
  • Migrating to oidc-agent 5
  • Installation
    • Linux
    • MacOS
    • Windows
  • Configuration
    • oidc-agent Directory
    • General Configuration
    • Custom Request Parameter
    • Configuration of Providers
    • oidc-agent Integration
    • Agent Forwarding
  • Usage
    • oidc-agent
      • Starting oidc-agent
      • General Usage
      • Detailed Information About All Options
    • oidc-agent-service
    • oidc-keychain
      • General Usage
      • Detailed Information About All Options
    • oidc-gen
      • General Usage
      • Detailed Information About All Options
      • Integrate With Different Providers
        • B2Access
        • EGI
        • Elixir
        • Google
        • HBP
        • Helmholtz AAI
        • IAM (INDIGO/DEEP)
        • KIT
        • Any Other Provider
        • Known Issues
        • Client Configuration Values
    • oidc-add
      • General Usage
      • Detailed Information About All Options
    • oidc-token
      • General Usage
      • Detailed Information About All Options
    • oidc-tokensh
      • General Usage
      • Detailed Information About All Options
    • Other Applications Using oidc-agent
    • Tips
    • oidc-agent-server
  • Windows
    • Installation
  • MAC OS
    • State of Feature Support
    • Installation
  • Security
    • Privilege Separation & Architecture
    • Account Configuration Files
    • Credentials
    • Memory
    • Agent Locking
    • Communication
    • Encryption Passwords
    • Autounload (Lifetime)
    • User Confirmation
    • Tracing
    • seccomp
    • Final Note
  • API
    • liboidc-agent4
    • liboidcagent-go
    • liboidcagent-py
    • IPC-API
Powered by GitBook
On this page
  1. Usage
  2. oidc-token

General Usage

Previousoidc-tokenNextDetailed Information About All Options

Last updated 8 months ago

To obtain an access token for a specific account configuration you have to pass the shortname to oidc-token: oidc-token <shortname> This will print the access token to stdout. This enables several use cases:

  • print the token to stdout and copy-paste it where you need it.

  • put the token in an environment variable: export OIDC_AT=`oidc-token shortname` .

  • use the -c (or similar) option to put the token into an environment variable: eval `oidc-token -c <shortname>`

  • pipe the token to a programm that reads a token from stdin: oidc-token shortname | iReadATokenFromStdIn.

  • use the oidc-token directly in the needed command: curl -H 'Authorization: Bearer `oidc-token shortname`' example.com.

    • use the --auth-header option to simplify api calls: curl -H "$(oidc-token shortname)" example.com

Instead of using oidc-token <shortname> you also can do oidc-token <issuer_url>. While usually using the shortname is shorter there are also use cases for using the issuer url.

See also for more usage tips.

Usage: oidc-token [OPTION...] ACCOUNT_SHORTNAME | ISSUER_URL

See for more information.

Tips
Detailed Information About All Options