Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
docs: add JWT, LDAP, and OCI authentication examples to Go SDK documentation
Victor Santos8a8d2b52a602
diff --git a/docs/sdks/languages/go.mdx b/docs/sdks/languages/go.mdxindex 26f8a36d3d..88dc6cf3b1 100644--- a/docs/sdks/languages/go.mdx+++ b/docs/sdks/languages/go.mdx@@ -284,6 +284,114 @@ if err != nil {}```+#### JWT Auth++<Info>+ Please note that this authentication method requires a valid JWT token from your JWT issuer. Please [read+ more](/documentation/platform/identities/jwt-auth) about this authentication+ method.+</Info>++**Using the SDK**++```go+credential, err := client.Auth().JwtAuthLogin("MACHINE_IDENTITY_ID", "JWT_TOKEN")++if err != nil {+ fmt.Println(err)+ os.Exit(1)+}+```++#### LDAP Auth++<Info>+ Please note that this authentication method requires LDAP credentials. Please [read+ more](/documentation/platform/identities/ldap-auth/general) about this authentication+ method.+</Info>++**Using environment variables**++You can set the `INFISICAL_LDAP_AUTH_IDENTITY_ID` environment variable and pass empty string for the identity ID:++```go+credential, err := client.Auth().LdapAuthLogin("", "LDAP_USERNAME", "LDAP_PASSWORD")++if err != nil {+ fmt.Println(err)+ os.Exit(1)+}+```++**Using the SDK directly**++```go+credential, err := client.Auth().LdapAuthLogin("MACHINE_IDENTITY_ID", "LDAP_USERNAME", "LDAP_PASSWORD")++if err != nil {+ fmt.Println(err)+ os.Exit(1)+}+```++#### OCI Auth++<Info>+ Please note that this authentication method will only work if you're running+ your application on Oracle Cloud Infrastructure. Please [read+ more](/documentation/platform/identities/oci-auth) about this authentication+ method.+</Info>++**Using environment variables**++You can set the `INFISICAL_OCI_AUTH_IDENTITY_ID` environment variable and omit the `IdentityID` field:++```go+credential, err := client.Auth().OciAuthLogin(infisical.OciAuthLoginOptions{+ UserID: "USER_OCID",+ TenancyID: "TENANCY_OCID",+ Fingerprint: "FINGERPRINT",+ PrivateKey: "PRIVATE_KEY",+ Region: "REGION",+})++if err != nil {+ fmt.Println(err)+ os.Exit(1)+}+```++**Using the SDK directly**++```go+credential, err := client.Auth().OciAuthLogin(infisical.OciAuthLoginOptions{+ IdentityID: "MACHINE_IDENTITY_ID",+ UserID: "USER_OCID",+ TenancyID: "TENANCY_OCID",+ Fingerprint: "FINGERPRINT",+ PrivateKey: "PRIVATE_KEY",+ Region: "REGION",+ Passphrase: nil, // Optional: pointer to string if your private key has a passphrase+})++if err != nil {+ fmt.Println(err)+ os.Exit(1)+}+```++**OciAuthLoginOptions fields:**++- `IdentityID` (string) - Your Infisical Machine Identity ID. Can be set via `INFISICAL_OCI_AUTH_IDENTITY_ID` environment variable.+- `UserID` (string) - Your OCI user OCID.+- `TenancyID` (string) - Your OCI tenancy OCID.+- `Fingerprint` (string) - Your OCI API key fingerprint.+- `PrivateKey` (string) - Your OCI private key (PEM format).+- `Region` (string) - Your OCI region (e.g., `us-ashburn-1`).+- `Passphrase` (*string) - Optional: pointer to passphrase string if your private key is encrypted.+## Secrets### List Secrets