1. Packages
  2. HashiCorp Vault Provider
  3. API Docs
  4. identity
  5. getOidcClientCreds
HashiCorp Vault v6.6.0 published on Thursday, Mar 13, 2025 by Pulumi

vault.identity.getOidcClientCreds

Explore with Pulumi AI

HashiCorp Vault v6.6.0 published on Thursday, Mar 13, 2025 by Pulumi

Example Usage

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

const app = new vault.identity.OidcClient("app", {
    name: "application",
    redirectUris: [
        "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
        "http://127.0.0.1:8251/callback",
        "http://127.0.0.1:8080/callback",
    ],
    idTokenTtl: 2400,
    accessTokenTtl: 7200,
});
const creds = vault.identity.getOidcClientCredsOutput({
    name: app.name,
});
Copy
import pulumi
import pulumi_vault as vault

app = vault.identity.OidcClient("app",
    name="application",
    redirect_uris=[
        "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
        "http://127.0.0.1:8251/callback",
        "http://127.0.0.1:8080/callback",
    ],
    id_token_ttl=2400,
    access_token_ttl=7200)
creds = vault.identity.get_oidc_client_creds_output(name=app.name)
Copy
package main

import (
	"github.com/pulumi/pulumi-vault/sdk/v6/go/vault/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		app, err := identity.NewOidcClient(ctx, "app", &identity.OidcClientArgs{
			Name: pulumi.String("application"),
			RedirectUris: pulumi.StringArray{
				pulumi.String("http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback"),
				pulumi.String("http://127.0.0.1:8251/callback"),
				pulumi.String("http://127.0.0.1:8080/callback"),
			},
			IdTokenTtl:     pulumi.Int(2400),
			AccessTokenTtl: pulumi.Int(7200),
		})
		if err != nil {
			return err
		}
		_ = identity.GetOidcClientCredsOutput(ctx, identity.GetOidcClientCredsOutputArgs{
			Name: app.Name,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Vault = Pulumi.Vault;

return await Deployment.RunAsync(() => 
{
    var app = new Vault.Identity.OidcClient("app", new()
    {
        Name = "application",
        RedirectUris = new[]
        {
            "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
            "http://127.0.0.1:8251/callback",
            "http://127.0.0.1:8080/callback",
        },
        IdTokenTtl = 2400,
        AccessTokenTtl = 7200,
    });

    var creds = Vault.Identity.GetOidcClientCreds.Invoke(new()
    {
        Name = app.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.vault.identity.OidcClient;
import com.pulumi.vault.identity.OidcClientArgs;
import com.pulumi.vault.identity.IdentityFunctions;
import com.pulumi.vault.identity.inputs.GetOidcClientCredsArgs;
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) {
        var app = new OidcClient("app", OidcClientArgs.builder()
            .name("application")
            .redirectUris(            
                "http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback",
                "http://127.0.0.1:8251/callback",
                "http://127.0.0.1:8080/callback")
            .idTokenTtl(2400)
            .accessTokenTtl(7200)
            .build());

        final var creds = IdentityFunctions.getOidcClientCreds(GetOidcClientCredsArgs.builder()
            .name(app.name())
            .build());

    }
}
Copy
resources:
  app:
    type: vault:identity:OidcClient
    properties:
      name: application
      redirectUris:
        - http://127.0.0.1:9200/v1/auth-methods/oidc:authenticate:callback
        - http://127.0.0.1:8251/callback
        - http://127.0.0.1:8080/callback
      idTokenTtl: 2400
      accessTokenTtl: 7200
variables:
  creds:
    fn::invoke:
      function: vault:identity:getOidcClientCreds
      arguments:
        name: ${app.name}
Copy

Using getOidcClientCreds

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 getOidcClientCreds(args: GetOidcClientCredsArgs, opts?: InvokeOptions): Promise<GetOidcClientCredsResult>
function getOidcClientCredsOutput(args: GetOidcClientCredsOutputArgs, opts?: InvokeOptions): Output<GetOidcClientCredsResult>
Copy
def get_oidc_client_creds(name: Optional[str] = None,
                          namespace: Optional[str] = None,
                          opts: Optional[InvokeOptions] = None) -> GetOidcClientCredsResult
def get_oidc_client_creds_output(name: Optional[pulumi.Input[str]] = None,
                          namespace: Optional[pulumi.Input[str]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetOidcClientCredsResult]
Copy
func GetOidcClientCreds(ctx *Context, args *GetOidcClientCredsArgs, opts ...InvokeOption) (*GetOidcClientCredsResult, error)
func GetOidcClientCredsOutput(ctx *Context, args *GetOidcClientCredsOutputArgs, opts ...InvokeOption) GetOidcClientCredsResultOutput
Copy

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

public static class GetOidcClientCreds 
{
    public static Task<GetOidcClientCredsResult> InvokeAsync(GetOidcClientCredsArgs args, InvokeOptions? opts = null)
    public static Output<GetOidcClientCredsResult> Invoke(GetOidcClientCredsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetOidcClientCredsResult> getOidcClientCreds(GetOidcClientCredsArgs args, InvokeOptions options)
public static Output<GetOidcClientCredsResult> getOidcClientCreds(GetOidcClientCredsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: vault:identity/getOidcClientCreds:getOidcClientCreds
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the OIDC Client in Vault.
Namespace Changes to this property will trigger replacement. string
The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
Name This property is required. string
The name of the OIDC Client in Vault.
Namespace Changes to this property will trigger replacement. string
The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
name This property is required. String
The name of the OIDC Client in Vault.
namespace Changes to this property will trigger replacement. String
The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
name This property is required. string
The name of the OIDC Client in Vault.
namespace Changes to this property will trigger replacement. string
The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
name This property is required. str
The name of the OIDC Client in Vault.
namespace Changes to this property will trigger replacement. str
The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.
name This property is required. String
The name of the OIDC Client in Vault.
namespace Changes to this property will trigger replacement. String
The namespace of the target resource. The value should not contain leading or trailing forward slashes. The namespace is always relative to the provider's configured namespace. Available only for Vault Enterprise.

getOidcClientCreds Result

The following output properties are available:

ClientId string
The Client ID returned by Vault.
ClientSecret string
The Client Secret Key returned by Vault. For public OpenID Clients client_secret is set to an empty string ""
Id string
The provider-assigned unique ID for this managed resource.
Name string
Namespace string
ClientId string
The Client ID returned by Vault.
ClientSecret string
The Client Secret Key returned by Vault. For public OpenID Clients client_secret is set to an empty string ""
Id string
The provider-assigned unique ID for this managed resource.
Name string
Namespace string
clientId String
The Client ID returned by Vault.
clientSecret String
The Client Secret Key returned by Vault. For public OpenID Clients client_secret is set to an empty string ""
id String
The provider-assigned unique ID for this managed resource.
name String
namespace String
clientId string
The Client ID returned by Vault.
clientSecret string
The Client Secret Key returned by Vault. For public OpenID Clients client_secret is set to an empty string ""
id string
The provider-assigned unique ID for this managed resource.
name string
namespace string
client_id str
The Client ID returned by Vault.
client_secret str
The Client Secret Key returned by Vault. For public OpenID Clients client_secret is set to an empty string ""
id str
The provider-assigned unique ID for this managed resource.
name str
namespace str
clientId String
The Client ID returned by Vault.
clientSecret String
The Client Secret Key returned by Vault. For public OpenID Clients client_secret is set to an empty string ""
id String
The provider-assigned unique ID for this managed resource.
name String
namespace String

Package Details

Repository
Vault pulumi/pulumi-vault
License
Apache-2.0
Notes
This Pulumi package is based on the vault Terraform Provider.
HashiCorp Vault v6.6.0 published on Thursday, Mar 13, 2025 by Pulumi