helpful-crowd-74546
04/05/2022, 5:55 PMhttps://<host>/callback
and get stuck in some redirect loop where the FlyteAdmin
Pod keeps logging like below. Does anyone know what could cause this? Thanks 🙂
flyteadmin-6d648c5c7b-x9w54 flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_idt] cookie found","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_idt] cookie found","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_at] cookie found","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"cookie.go:71"},"level":"info","msg":"Could not detect existing cookie [flyte_rt]. Error: http: named cookie not present","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"cookie_manager.go:71"},"level":"info","msg":"Refresh token doesn't exist or failed to read it. Ignoring this error. Error: [EMPTY_OAUTH_TOKEN] Failure to retrieve cookie [flyte_rt], caused by: http: named cookie not present","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_user_info] cookie found","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"handlers.go:227"},"level":"debug","msg":"Running authentication gRPC interceptor","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"token.go:84"},"level":"debug","msg":"Could not retrieve bearer token from metadata rpc error: code = Unauthenticated desc = Request unauthenticated with Bearer","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"handlers.go:237"},"level":"info","msg":"Failed to parse Access Token from context. Will attempt to find IDToken. Error: [JWT_VERIFICATION_FAILED] Could not retrieve bearer token from metadata, caused by: rpc error: code = Unauthenticated desc = Request unauthenticated with Bearer","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-2m4zv flyteadmin {"json":{"src":"token.go:64"},"level":"debug","msg":"JWT parsing with claims failed failed to verify signature: failed to verify id token signature","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-x9w54 flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_at] cookie found","ts":"2022-04-05T17:46:04Z"}
flyteadmin-6d648c5c7b-x9w54 flyteadmin {"json":{"src":"cookie.go:71"},"level":"info","msg":"Could not detect existing cookie [flyte_rt]. Error: http: named cookie not present","ts":"2022-04-05T17:46:04Z"}
icy-agent-73298
04/06/2022, 4:27 AMfailed to verify id token signature
and it could potentially point to a misconfigured JWKS URIhelpful-crowd-74546
04/06/2022, 6:24 AMhelpful-crowd-74546
04/06/2022, 11:11 AMhttps://<host>/me
reproduces the error we see in the FlyteAdmin logs.
I am probably missing something, but it is hard to defer what exactly, do you have any examples of Azure AD to make sure we are using the correct baseUrl for instance? We are currently using baseUrl: <https://sts.windows.net/><tentant_id>/
and have also tried `baseUrl: https://login.microsoft.net/<tenant_id>/`with similar issuesicy-agent-73298
04/06/2022, 11:21 AMicy-agent-73298
04/06/2022, 11:30 AM<https://login.microsoftonline.com/{tenant}/v2.0/.well-known/openid-configuration?appId=>.....
Referred this doc https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc
Can we check the jwks_uri . Probably provide the o/p of this metadata might helphelpful-crowd-74546
04/06/2022, 11:34 AM"jwks_uri": "<https://login.microsoftonline.com/><tenant_id>/discovery/v2.0/keys"
icy-agent-73298
04/06/2022, 11:39 AM<https://login.microsoftonline.com/{tenant}/v2.0>
helpful-crowd-74546
04/06/2022, 11:47 AM"token parse error [JWT_VERIFICATION_FAILED] jwt parse with claims failed, caused by: failed to verify signature: failed to verify id token signature"
helpful-crowd-74546
04/06/2022, 11:48 AMflyteadmin-5df48d7fc-5pjql flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_idt] cookie found","ts":"2022-04-06T11:45:48Z"}
flyteadmin-5df48d7fc-5pjql flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_at] cookie found","ts":"2022-04-06T11:45:48Z"}
flyteadmin-5df48d7fc-5pjql flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_rt] cookie found","ts":"2022-04-06T11:45:48Z"}
flyteadmin-5df48d7fc-5pjql flyteadmin {"json":{"src":"cookie.go:80"},"level":"debug","msg":"Existing [flyte_user_info] cookie found","ts":"2022-04-06T11:45:48Z"}
icy-agent-73298
04/06/2022, 12:52 PM<ttps://login.microsoftonline.com/><tenant_id>/discovery/v2.0/keys
icy-agent-73298
04/06/2022, 12:54 PMicy-agent-73298
04/06/2022, 12:56 PMsticky-printer-535
04/06/2022, 1:04 PMhelpful-crowd-74546
04/06/2022, 1:05 PMhelpful-crowd-74546
04/06/2022, 6:18 PM<https://login.microsoftonline.com/><tenant_id>/discovery/v2.0/keys?appId=<app_id>
. Note the additional appId
parameter needed for Azure AD apps with custom signing keys. This is discussed in this issue here (originating from https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-protocols-oidc#sample-response)helpful-crowd-74546
04/06/2022, 6:22 PMNewProvider
is created the appId
is not appended https://github.com/coreos/go-oidc/blob/2d47dd95152744f41009de5797efe6cc07832a41/oidc/oidc.go#L184-L185helpful-crowd-74546
04/06/2022, 7:47 PMhigh-park-82026
/.well-known/openid-configuration
value a config option with /.well-known/openid-configuration
as the default… and in your deployment you can customize it to append the app id.. what do you think?high-park-82026
freezing-airport-6809
freezing-airport-6809
icy-agent-73298
04/07/2022, 2:55 AMbaseUrl: <https://login.microsoftonline.com/{tenant}/v2.0>
metadataUrl: .well-known/openid-configuration?appid=6731de76-14a6-49ae-97bc-6eba6914391e
This should avoid any code changes specific tp azureicy-agent-73298
04/07/2022, 3:07 AMicy-agent-73298
04/07/2022, 4:30 AMhelpful-crowd-74546
04/07/2022, 4:27 PMapp_id=<clientId>
to the issuer URL. Hence, it could be that it works out of the box with Azure AD IdP given an app registered without customized claims (please see here for more info) - not sure at this point if claims are customized on a company level or per app, but we should try this.
Otherwise it seems to me that we would need to infer in the ParseIDTokenAndValidate:
1. If the issuer is Microsoft and the Azure AD app is registered
2. Then add ?app_id=<clientId>
to JWTURL
However, given the scope of this function, the information about the JWTURL is not available as far as I can tell so we would need to pass that along. What you suggest @User sounds good, i.e., initialize the Provider using the ProviderConfig struct where the Provider.remoteKeySet
is created given some logic to infer whether the Issuer is customized claims Azure AD app. This alternative however requires to bump the oidc package from v2.x to v3.x as this feature was added only in v3 it seems. I have very little experience with authentication and different identitiy providers so I could of course be missing something! What do you guys think is the best way forward here?icy-agent-73298
04/08/2022, 6:20 AMhelpful-crowd-74546
04/08/2022, 4:31 PMProviderConfig
. I suggest we wait until Monday when I hopefully get to experiment with a new Azure app, and we decide on next steps after that. Sounds good?icy-agent-73298
04/08/2022, 5:38 PMhelpful-crowd-74546
04/11/2022, 8:28 AMicy-agent-73298
04/11/2022, 8:40 AMhelpful-crowd-74546
04/11/2022, 1:29 PMicy-agent-73298
04/11/2022, 1:46 PMfreezing-airport-6809