File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
src/main/java/io/github/jopenlibs/vault/api Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -1093,6 +1093,31 @@ public AuthResponse loginByKubernetes(final String role, final String jwt)
10931093 return loginByJwt ("kubernetes" , role , jwt );
10941094 }
10951095
1096+ /**
1097+ * Basic login operation to authenticate to a kubernetes backend with custom path. Example usage:
1098+ *
1099+ * <blockquote>
1100+ *
1101+ * <pre>{@code
1102+ * final AuthResponse response =
1103+ * vault.auth().loginByKubernetes("dev", "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "customAuthPath");
1104+ *
1105+ * final String token = response.getAuthClientToken();
1106+ * }</pre>
1107+ * </blockquote>
1108+ *
1109+ * @param role The kubernetes role used for authentication
1110+ * @param jwt The JWT token for the role, typically read from
1111+ * /var/run/secrets/kubernetes.io/serviceaccount/token
1112+ * @param authPath The Authentication Path for Vault
1113+ * @return The auth token, with additional response metadata
1114+ * @throws VaultException If any error occurs, or unexpected response received from Vault
1115+ */
1116+ public AuthResponse loginByKubernetes (final String role , final String jwt , final String authPath )
1117+ throws VaultException {
1118+ return loginByJwt ("kubernetes" , role , jwt , authPath );
1119+ }
1120+
10961121 /**
10971122 * <p>Basic login operation to authenticate using Vault's TLS Certificate auth backend.
10981123 * Example usage:</p>
You can’t perform that action at this time.
0 commit comments