-
Notifications
You must be signed in to change notification settings - Fork 702
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
[BUG] Flytectl authentication not working with GCP IAP #6089
Comments
Thank you for opening your first issue here! 🛠 |
@gverkes , can you confirm that running the Also, can you increase the log level in the invocation of |
Hello, I got to the bottom of this, and I can share exactly what is happening. We followed these instructions to the letter, and we can confirm that the python aspect of things works, so we are able to run the following code successfully. from flytekit.remote import FlyteRemote
from flytekit.configuration import Config
remote = FlyteRemote(
config=Config.auto(),
default_project="flytesnacks",
default_domain="development",
)
print(remote.recent_executions()) with this configuration file
The problem we experience is actually only appearing with the golang based code (or at least, with ![]() in the specific, we can see that while the GRPC based connections have the correct |
According to copilot....
Your observation is correct. The The issue with the current code is that it does not correctly handle the case when Here's an example of how you might update the func (c *proxyAuthTransport) RoundTrip(req *http.Request) (*http.Response, error) {
// check if the proxy credentials future is initialized
if !c.proxyCredentialsFuture.IsInitialized() {
return nil, errors.New("proxy credentials not initialized")
}
// Retrieve the token from the proxy credentials future
token, err := c.proxyCredentialsFuture.Token()
if err != nil {
return nil, err
}
// Add the ProxyAuthorizationHeader to the request
req.Header.Set(ProxyAuthorizationHeader, token.AccessToken)
// Proceed with the round trip
return c.transport.RoundTrip(req)
} This modification ensures that the |
That is pretty cool, thanks for the investigation. @ademariag, would you be willing to contribute a PR? |
Describe the bug
After having set up IAP with Flyte according to https://pypi.org/project/flytekitplugins-identity-aware-proxy/, the
flytectl
command during flyte authentication seems to fail due to IAP. During the Flyte authentication the initial IAP works fine, but during the callback I get the error:Couldn't get access token due to error: oauth2: cannot fetch token: 401 Unauthorized Response: Invalid IAP credentials: empty token
. Connecting through Flytekit or the console works fine.versions
flyte-core
:1.13.3
Expected behavior
The proxyCommand provides a token for IAP, that should be properly propagated, such that the Flyte authentication succeeds. Just like Flytekit
Additional context to reproduce
config.yaml
to something like (also used for flytekit, which does work):flytectl get project
Screenshots
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: