Files
coder/docs/reference/cli/external-auth/access-token.md
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

106 lines
2.9 KiB
Markdown
Raw Normal View History

---
# Code generated by make gen. DO NOT EDIT.
title: "`coder external-auth access-token`"
description: Print auth for an external provider.
---
2023-10-09 18:04:35 -05:00
<!-- DO NOT EDIT | GENERATED CONTENT -->
Print auth for an external provider
## Usage
```console
coder external-auth access-token [flags] <provider>
```
## Description
```console
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
2023-10-09 18:04:35 -05:00
```
## Options
### --extra
2023-10-09 18:04:35 -05:00
| Property | Value |
|----------|---------------------|
| Type | <code>string</code> |
2023-10-09 18:04:35 -05:00
Extract a field from the "extra" properties of the OAuth token.
### --output
| Property | Value |
|----------|-------------------------|
| Type | <code>text\|json</code> |
| Default | <code>text</code> |
Output format. Available formats: text, json.
### --agent-token
| Property | Value |
|-------------|---------------------------------|
| Type | <code>string</code> |
| Environment | <code>$CODER_AGENT_TOKEN</code> |
An agent authentication token.
### --agent-token-file
| Property | Value |
|-------------|--------------------------------------|
| Type | <code>string</code> |
| Environment | <code>$CODER_AGENT_TOKEN_FILE</code> |
A file containing an agent authentication token.
### --agent-url
| Property | Value |
|-------------|-------------------------------|
| Type | <code>url</code> |
| Environment | <code>$CODER_AGENT_URL</code> |
URL for an agent to access your deployment.
### --auth
| Property | Value |
|-------------|--------------------------------|
| Type | <code>string</code> |
| Environment | <code>$CODER_AGENT_AUTH</code> |
| Default | <code>token</code> |
Specify the authentication type to use for the agent.
### --agent-name
| Property | Value |
|-------------|--------------------------------|
| Type | <code>string</code> |
| Environment | <code>$CODER_AGENT_NAME</code> |
The name of the agent to authenticate as (only applicable for instance identity).