IAM_AUTH-TOKEN(1)

NAME
iam_auth-token -

DESCRIPTION

An AuthToken is an Oracle-generated token string that you can use to authenticate with third-party APIs that do not support Oracle Cloud Infrastructure’s signature-based authentication. For example, use an AuthToken to authenticate with a Swift client with the Object Storage Service.

The auth token is associated with the user’s Console login. Auth tokens never expire. A user can have up to two auth tokens at a time.

Note: The token is always an Oracle-generated string; you can’t change it to a string of your choice.

For more information, see Managing User Credentials <https://docs.cloud.oracle.com/Content/Identity/access/managing-user-credentials.htm>.

AVAILABLE COMMANDS

•   create

•   delete

•   list

•   update

  create

•   Description

•   Usage

•   Required Parameters

•   Optional Parameters

•   Global Parameters

•   Example using required parameter

  Description

Creates a new auth token for the specified user. For information about what auth tokens are for, see Managing User Credentials <https://docs.cloud.oracle.com/Content/Identity/access/managing-user-credentials.htm>.

You must specify a description for the auth token (although it can be an empty string). It does not have to be unique, and you can change it anytime with UpdateAuthToken <https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/auth-token/update.html>.

Every user has permission to create an auth token for their own user ID. An administrator in your organization does not need to write a policy to give users this ability. To compare, administrators who have permission to the tenancy can use this operation to create an auth token for any user, including themselves.

  Usage

oci iam auth-token create [OPTIONS]

  Required Parameters

--description [text]

    The description you assign to the auth token during creation. Does not have to be unique, and it’s changeable.

    (For tenancies that support identity domains) You can have an empty description.

--user-id [text]

    The OCID of the user.

  Optional Parameters

--from-json [text]

    Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

    The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

    Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

    For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

  Global Parameters

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --connection-timeout, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --proxy, --query, --raw-output, --read-timeout, --realm-specific-endpoint, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

  Example using required parameter

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export description=<substitute-value-of-description> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-description
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-name
    user_id=$(oci iam user create --description $description --name $name --query data.id --raw-output)
    oci iam auth-token create --description $description --user-id $user_id

  delete

•   Description

•   Usage

•   Required Parameters

•   Optional Parameters

•   Global Parameters

•   Example using required parameter

  Description

Deletes the specified auth token for the specified user.

  Usage

oci iam auth-token delete [OPTIONS]

  Required Parameters

--auth-token-id [text]

    The OCID of the auth token.

--user-id [text]

    The OCID of the user.

  Optional Parameters

--force

    Perform deletion without prompting for confirmation.

--from-json [text]

    Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

    The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

    Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

    For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--if-match [text]

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

  Global Parameters

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --connection-timeout, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --proxy, --query, --raw-output, --read-timeout, --realm-specific-endpoint, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

  Example using required parameter

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export description=<substitute-value-of-description> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-description
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-name
    user_id=$(oci iam user create --description $description --name $name --query data.id --raw-output)
    auth_token_id=$(oci iam auth-token create --description $description --user-id $user_id --query data.id --raw-output)
    oci iam auth-token delete --auth-token-id $auth_token_id --user-id $user_id

  list

•   Description

•   Usage

•   Required Parameters

•   Optional Parameters

•   Global Parameters

•   Example using required parameter

  Description

Lists the auth tokens for the specified user. The returned object contains the token’s OCID, but not the token itself. The actual token is returned only upon creation.

  Usage

oci iam auth-token list [OPTIONS]

  Required Parameters

--user-id [text]

    The OCID of the user.

  Optional Parameters

--all

    Fetches all pages of results.

--from-json [text]

    Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

    The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

    Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

    For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

  Global Parameters

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --connection-timeout, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --proxy, --query, --raw-output, --read-timeout, --realm-specific-endpoint, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

  Example using required parameter

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export description=<substitute-value-of-description> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-description
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-name
    user_id=$(oci iam user create --description $description --name $name --query data.id --raw-output)
    oci iam auth-token list --user-id $user_id

  update

•   Description

•   Usage

•   Required Parameters

•   Optional Parameters

•   Global Parameters

•   Example using required parameter

  Description

Updates the specified auth token’s description.

  Usage

oci iam auth-token update [OPTIONS]

  Required Parameters

--auth-token-id [text]

    The OCID of the auth token.

--user-id [text]

    The OCID of the user.

  Optional Parameters

--description [text]

    The description you assign to the auth token. Does not have to be unique, and it’s changeable.

    (For tenancies that support identity domains) You can have an empty description.

--from-json [text]

    Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

    The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

    Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

    For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--if-match [text]

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource’s current etag value.

  Global Parameters

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --connection-timeout, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --proxy, --query, --raw-output, --read-timeout, --realm-specific-endpoint, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

  Example using required parameter

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export description=<substitute-value-of-description> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-description
    export name=<substitute-value-of-name> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/iam/user/create.html#cmdoption-name
    user_id=$(oci iam user create --description $description --name $name --query data.id --raw-output)
    auth_token_id=$(oci iam auth-token create --description $description --user-id $user_id --query data.id --raw-output)
    oci iam auth-token update --auth-token-id $auth_token_id --user-id $user_id

AUTHOR
Oracle

COPYRIGHT
2016, 2024, Oracle