[英]How do I get the username for the IAM user when trying to connect to Google CloudSQL using a unix socket on a cloudrun instance?
I have the following code to get my username from a env var in a run instance using Java...我有以下代码使用 Java 从运行实例中的 env var 获取我的用户名...
String dbUser = Optional.ofNullable(System.getenv("DB_USER")).orElseGet(() -> {
EXIT.accept("You must Provide a DB Username");
return null;
});
My main question is, since I am using IAM auth, is there a way I can get this username without having to use an Env Variable.我的主要问题是,由于我使用的是 IAM 身份验证,有没有一种方法可以在不使用 Env 变量的情况下获取此用户名。 Kind of like how the password can be empty.
有点像密码可以为空。
As explained in the documentation , the username must be provided, not the password.如文档中所述,必须提供用户名,而不是密码。 The user access token act as validation of the user name account and grant the authorized users.
用户访问令牌充当用户名帐户的验证并授予授权用户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.