-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for specifying custom credentials #200
Comments
The issue seems to be the auth being different. Can we update the connector instance to accept custom auth? |
I am curious, what do you mean by custom auth? |
We have a service account, and our API impersonates the service account using cloud Impersonated. When we connect via the Impersonated service account using this connector we get 403 error since it defaults to application default login. |
@Anoupz I don't fully understand your setup from the description that you provided. However, Application Default Credentials support service account impersonation. For example, locally you can try it out by running: gcloud auth application-default login --impersonate-service-account $SERVICE_ACCOUNT_EMAIL Cloud SQL Node.js Connector uses standard There is also an example of Application Default Credentials file that uses impersonation. This is something that I use and it works as expected. |
Thanks @edosrecki. I'm using a backend API in Node.js, and we make use of the Impersonated class provided by the google-auth-library. You can find more information about it here: https://cloud.google.com/nodejs/docs/reference/google-auth-library/latest/google-auth-library/impersonated We utilize the authentication credentials generated by this instantiation of the Impersonated class across our various services to authenticate our service account. When it comes to testing our APIs locally, we establish a connection using our developer's gcloud credentials, and the API impersonates the service account, granting us access to cloud services. To initiate this process, I execute the command If the connector can indeed accept custom authentication and pass it down to the I am open to more ideas. |
|
Hi @Anoupz, as @edosrecki mentioned,
@Anoupz are you initializing this command with the |
@edosrecki & @jackwotherspoon, Again thanks for all the help and info. |
@Anoupz I understand your use-case now! Appreciate the detailed explanation 😄 I have changed this issue into a feature request for allowing a custom Thanks for raising this! |
Thanks @jackwotherspoon. I am happy to contribute as well. I have submitted the Contributor License Agreement. But still don't have access to create a PR. Let me know if I need follow up something else. |
We always welcome external contributions 😄 If you create a fork of the repository you can then push changes to your fork for development. You should then be able to open a PR using your fork. Let me know if this doesn't work for you and I can provide more details. Here is the Python PR that implemented this feature in the Python Connector just in case it helps provide any guidance. |
Thanks @jackwotherspoon I was able to create the PR. |
@jackwotherspoon and @edosrecki can you help me with this PR. Appreciate all the help |
cc @ruyadorno. |
Hi @Anoupz you can join the follow up conversation in original PR: #204 It looks like at this point in time we're blocked on a Thanks for the help! |
Adds a new `auth` property to the connector constructor that can be used by `SQLAdminFetcher` to extend from or provide support to a custom auth object defined by the user. Fixes: #200
Question
Getting this error
I am connecting with my service account and I verified that the user has cloudsql.admin. Any help?
Additional Context
The text was updated successfully, but these errors were encountered: