1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. getAuthTokens
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.Identity.getAuthTokens

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

This data source provides the list of Auth Tokens in Oracle Cloud Infrastructure Identity service.

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.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testAuthTokens = oci.Identity.getAuthTokens({
    userId: testUser.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_auth_tokens = oci.Identity.get_auth_tokens(user_id=test_user["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := identity.GetAuthTokens(ctx, &identity.GetAuthTokensArgs{
			UserId: testUser.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testAuthTokens = Oci.Identity.GetAuthTokens.Invoke(new()
    {
        UserId = testUser.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.IdentityFunctions;
import com.pulumi.oci.Identity.inputs.GetAuthTokensArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testAuthTokens = IdentityFunctions.getAuthTokens(GetAuthTokensArgs.builder()
            .userId(testUser.id())
            .build());

    }
}
Copy
variables:
  testAuthTokens:
    fn::invoke:
      function: oci:Identity:getAuthTokens
      arguments:
        userId: ${testUser.id}
Copy

Using getAuthTokens

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getAuthTokens(args: GetAuthTokensArgs, opts?: InvokeOptions): Promise<GetAuthTokensResult>
function getAuthTokensOutput(args: GetAuthTokensOutputArgs, opts?: InvokeOptions): Output<GetAuthTokensResult>
Copy
def get_auth_tokens(filters: Optional[Sequence[_identity.GetAuthTokensFilter]] = None,
                    user_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetAuthTokensResult
def get_auth_tokens_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_identity.GetAuthTokensFilterArgs]]]] = None,
                    user_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetAuthTokensResult]
Copy
func GetAuthTokens(ctx *Context, args *GetAuthTokensArgs, opts ...InvokeOption) (*GetAuthTokensResult, error)
func GetAuthTokensOutput(ctx *Context, args *GetAuthTokensOutputArgs, opts ...InvokeOption) GetAuthTokensResultOutput
Copy

> Note: This function is named GetAuthTokens in the Go SDK.

public static class GetAuthTokens 
{
    public static Task<GetAuthTokensResult> InvokeAsync(GetAuthTokensArgs args, InvokeOptions? opts = null)
    public static Output<GetAuthTokensResult> Invoke(GetAuthTokensInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAuthTokensResult> getAuthTokens(GetAuthTokensArgs args, InvokeOptions options)
public static Output<GetAuthTokensResult> getAuthTokens(GetAuthTokensArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Identity/getAuthTokens:getAuthTokens
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

UserId This property is required. string
The OCID of the user.
Filters Changes to this property will trigger replacement. List<GetAuthTokensFilter>
UserId This property is required. string
The OCID of the user.
Filters Changes to this property will trigger replacement. []GetAuthTokensFilter
userId This property is required. String
The OCID of the user.
filters Changes to this property will trigger replacement. List<GetAuthTokensFilter>
userId This property is required. string
The OCID of the user.
filters Changes to this property will trigger replacement. GetAuthTokensFilter[]
user_id This property is required. str
The OCID of the user.
filters Changes to this property will trigger replacement. Sequence[identity.GetAuthTokensFilter]
userId This property is required. String
The OCID of the user.
filters Changes to this property will trigger replacement. List<Property Map>

getAuthTokens Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Tokens List<GetAuthTokensToken>
The list of tokens.
UserId string
The OCID of the user the auth token belongs to.
Filters List<GetAuthTokensFilter>
Id string
The provider-assigned unique ID for this managed resource.
Tokens []GetAuthTokensToken
The list of tokens.
UserId string
The OCID of the user the auth token belongs to.
Filters []GetAuthTokensFilter
id String
The provider-assigned unique ID for this managed resource.
tokens List<GetAuthTokensToken>
The list of tokens.
userId String
The OCID of the user the auth token belongs to.
filters List<GetAuthTokensFilter>
id string
The provider-assigned unique ID for this managed resource.
tokens GetAuthTokensToken[]
The list of tokens.
userId string
The OCID of the user the auth token belongs to.
filters GetAuthTokensFilter[]
id str
The provider-assigned unique ID for this managed resource.
tokens Sequence[identity.GetAuthTokensToken]
The list of tokens.
user_id str
The OCID of the user the auth token belongs to.
filters Sequence[identity.GetAuthTokensFilter]
id String
The provider-assigned unique ID for this managed resource.
tokens List<Property Map>
The list of tokens.
userId String
The OCID of the user the auth token belongs to.
filters List<Property Map>

Supporting Types

GetAuthTokensFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetAuthTokensToken

Description This property is required. string
The description you assign to the auth token. Does not have to be unique, and it's changeable.
Id This property is required. string
The OCID of the auth token.
InactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
State This property is required. string
The token's current state.
TimeCreated This property is required. string
Date and time the AuthToken object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires This property is required. string
Date and time when this auth token will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
Token This property is required. string
The auth token. The value is available only in the response for CreateAuthToken, and not for ListAuthTokens or UpdateAuthToken.
UserId This property is required. string
The OCID of the user.
Description This property is required. string
The description you assign to the auth token. Does not have to be unique, and it's changeable.
Id This property is required. string
The OCID of the auth token.
InactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
State This property is required. string
The token's current state.
TimeCreated This property is required. string
Date and time the AuthToken object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires This property is required. string
Date and time when this auth token will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
Token This property is required. string
The auth token. The value is available only in the response for CreateAuthToken, and not for ListAuthTokens or UpdateAuthToken.
UserId This property is required. string
The OCID of the user.
description This property is required. String
The description you assign to the auth token. Does not have to be unique, and it's changeable.
id This property is required. String
The OCID of the auth token.
inactiveState This property is required. String
The detailed status of INACTIVE lifecycleState.
state This property is required. String
The token's current state.
timeCreated This property is required. String
Date and time the AuthToken object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires This property is required. String
Date and time when this auth token will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
token This property is required. String
The auth token. The value is available only in the response for CreateAuthToken, and not for ListAuthTokens or UpdateAuthToken.
userId This property is required. String
The OCID of the user.
description This property is required. string
The description you assign to the auth token. Does not have to be unique, and it's changeable.
id This property is required. string
The OCID of the auth token.
inactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
state This property is required. string
The token's current state.
timeCreated This property is required. string
Date and time the AuthToken object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires This property is required. string
Date and time when this auth token will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
token This property is required. string
The auth token. The value is available only in the response for CreateAuthToken, and not for ListAuthTokens or UpdateAuthToken.
userId This property is required. string
The OCID of the user.
description This property is required. str
The description you assign to the auth token. Does not have to be unique, and it's changeable.
id This property is required. str
The OCID of the auth token.
inactive_state This property is required. str
The detailed status of INACTIVE lifecycleState.
state This property is required. str
The token's current state.
time_created This property is required. str
Date and time the AuthToken object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
time_expires This property is required. str
Date and time when this auth token will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
token This property is required. str
The auth token. The value is available only in the response for CreateAuthToken, and not for ListAuthTokens or UpdateAuthToken.
user_id This property is required. str
The OCID of the user.
description This property is required. String
The description you assign to the auth token. Does not have to be unique, and it's changeable.
id This property is required. String
The OCID of the auth token.
inactiveState This property is required. String
The detailed status of INACTIVE lifecycleState.
state This property is required. String
The token's current state.
timeCreated This property is required. String
Date and time the AuthToken object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires This property is required. String
Date and time when this auth token will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
token This property is required. String
The auth token. The value is available only in the response for CreateAuthToken, and not for ListAuthTokens or UpdateAuthToken.
userId This property is required. String
The OCID of the user.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi