Coder powers secure, scalable development across key industries — automotive, finance, government, and technology — enabling faster builds, tighter compliance, and seamless AI adoption in enterprise-grade cloud environments.
Print an access-token for an external auth provider. The access-token will be validated and sent to stdout with exit code 0. If a valid access-token cannot be obtained, the URL to authenticate will be sent to stdout with exit code 1
- Ensure that the user is authenticated with GitHub before cloning.:
$ #!/usr/bin/env sh
OUTPUT=$(coder external-auth access-token github)
if [ $? -eq 0 ]; then
echo "Authenticated with GitHub"
else
echo "Please authenticate with GitHub:"
echo $OUTPUT
fi
- Obtain an extra property of an access token for additional metadata.:
$ coder external-auth access-token slack --extra "authed_user.id"
- Print the full token response as JSON.:
$ coder external-auth access-token github --output json
Options
--extra
Property
Value
Type
string
Extract a field from the "extra" properties of the OAuth token.
--output
Property
Value
Type
text|json
Default
text
Output format. Available formats: text, json.
--agent-token
Property
Value
Type
string
Environment
$CODER_AGENT_TOKEN
An agent authentication token.
--agent-token-file
Property
Value
Type
string
Environment
$CODER_AGENT_TOKEN_FILE
A file containing an agent authentication token.
--agent-url
Property
Value
Type
url
Environment
$CODER_AGENT_URL
URL for an agent to access your deployment.
--auth
Property
Value
Type
string
Environment
$CODER_AGENT_AUTH
Default
token
Specify the authentication type to use for the agent.
--agent-name
Property
Value
Type
string
Environment
$CODER_AGENT_NAME
The name of the agent to authenticate as (only applicable for instance identity).