hashicorp / hello-vault-go

Runnable examples in Go of how to integrate an application with HashiCorp Vault.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to configure the OIDC config with GO package-github.com/hashicorp/vault/api

mayankmike86 opened this issue · comments

We are able to initialize/unseal and enable the vault using bellow code.

newres, err := client.Sys().Init(&intireq)
resseal, err := client.Sys().Unseal("xxxxxxxxxxxxxxxxxxxxx")
fmt.Println("resseal:", resseal)
enableopt := vault.MountInput{}
enableopt.Type = "oidc"
client.SetToken("xxxxxxxxxxxxxxxxxx")

err = client.Sys().EnableAuthWithOptions("oidc", &enableopt)
We can see oidc enabled in UI also. Now we need to configure the oidc, which if done from UI it is using below POST api with configs id: "oidc", oidc_discovery_url:"xxxxxx"......

https://vault.xxxxxx.com/v1/auth/oidc/config
We need to configure the same from our GO code where we are using go client vault "github.com/hashicorp/vault/api"

Not able to get the method for auth configuration need help on correct method.

Hi there! Thanks for reaching out. As this seems to be more of a question and not a bug or feature request, it might be a question better suited for our discussion forum which you can find here.