-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Failed to verify token: oidc: expected audience "argo-cd-cli" got ["argo-cd"] #13432
Comments
Hey having this same isue. upgrading from 2.6.7 to 2.7.3 Please advise on a solution this is blocking. |
We upgraded to 2.7.3 and had the same issue. Rolling back to the previous version didn't fix it. Completely uninstalling ArgoCD and redeploying 2.7.3 it fixed the issue for us. |
Same issue in 2.7.1 |
|
@paoll Could you please confirm if that issue actually breaks the authorization flow in your case? If it does - which error do you see in the browser? P.s. I'm seeing the same warning on v2.7.10 |
@legal90, afaik it does not break the authorization flow, as the the authentication one is working (users can login and use dashboard mainly as read-only). We don't operate actions through the dashboard, and everyone can see everything, so if we had authorization issue, we would'nt notice. The only dysfunctional behavior we're experiencing is the error message from |
We are also experiencing this issue on v2.8.2+dbdfc71 |
Reducing the Dex replications 3 -> 1 seemingly solved this for me |
The error message is likely misleading. The token verification code loops over allowed audiences, runs token verification for each, and logs the last error message encountered. In this case I believe the first error message (the relevant one) was discarded, and the second error message was irrelevant (because it was attempting to verify the wrong audience). This change will cause all token verification errors to be logged: |
Having same issue with gitlab <-> dex
|
To be clear, I think it's possible that every person on this thread is facing a completely different issue, hidden by an irrelevant error message. |
After upgrading an ArgoCD 2.3.10 instance to 2.6.15, I'm seeing the following in the argocd-server logs:
These are happening once per second. That doesn't match the liveness (30s) or readiness (10s) probe periods, so I'm trying to find out why these are happening. To be clear, nothing seems broken. Dex is working just fine and SSO (Google) works. I just want to figure out why this is happening in order to improve the logs. EDIT: Could this be users with old ArgoCD JS cached and invalidated sessions that are trying to access the upgraded ArgoCD? |
100% I think we should follow this suggestion: coreos/go-oidc#406 (review) We should skip the client ID check in the go-oidc library and instead check it ourselves. That'll allow us to ignore irrelevant "failed to verify token" errors and instead log the actual error. |
Me as well. SSO login on UI working fine.
with logs:
I only have a single dex replica, never had more than one. Note that ripping the token out of my cookie from the UI and using it with the CLI works, so that's a possible workaround for those in need. |
This exact issue happened to us seemingly out of nowhere. These log entries correlated perfectly with a sudden wave of requests in our network logs with a HTTP 401 result. They all ended up being requests to:
with the Referer field set to: So this definitely seems like a bug in the UI, where it endlessly tries to refresh the Applications listing even though all its getting in response is 401s. Let me know if you want me to provide any more details on this 🙏 |
Just commenting that I don't think that's at all the issue I'm having; whatever might be happening in a browser somewhere shouldn't affect me trying to login with the CLI. |
We're seeing this is one of our environments (the least critical thankfully): Running v2.10.2+fcf5d8c from this YAML. Our logger:
level: debug
format: json
connectors:
- type: saml
id: saml
name: saml
config:
entityIssuer: $sso:externalUrl
ssoURL: $sso:ssoUrl
caData: $sso:certificate
redirectURI: $sso:externalUrl
usernameAttr: email
emailAttr: email
groupsAttr: Group We're observing ArgoCD being slow as molasses and the error message |
It's possible that every person on this thread is experiencing an entirely different root cause. We won't know until we make changes to avoid obscuring the actual token validation error.
This is where the change should be make. Line 122 in 565aa8e
|
Actually, I forgot I wrote code to log all audiences' error messages. That'll be in 2.11. |
Entirely possible; hopefully people come back with more details.
I'll check it out when I get to 2.11 then and report back; fortunately only I use the CLI and even then very occasionally, even the UI is only for monitoring as everything else is declarative in my case. Though, there's still a few CLI things I need to do occasionally and it'd be nice to not have to kick things and copy/paste tokens around. :-) |
@crenshaw-dev I have upgraded 2.10 to 2.11 RC1 and we're seeing a single oidc connector fail with a similar but reversed error message as everyone else in this issue.
Unfortunately even in the 2.11 RC image this seems to be the only information logged. The connector that's failing is related to the single place where we use the argo cli, in a CI pipeline. Users are having no issue with our integrated SSO in the UI. We fetch the appropriate CLI version from the server during the pipeline and generate a token in each run from a secret. # Using Buildkite JWT to generate a token for Dex
BUILDKITE_JWT=$(buildkite-agent oidc request-token \
--lifetime 300 \
--audience argo-cd-cli )
export ARGOCD_AUTH_TOKEN=$(curl http://${ARGOCD_SERVER}/api/dex/token \
--user argo-cd-cli:bk-oidc-secret \
--data-urlencode connector_id=bk-oidc \
--data-urlencode grant_type=urn:ietf:params:oauth:grant-type:token-exchange \
--data-urlencode scope="openid groups federated:id" \
--data-urlencode requested_token_type=urn:ietf:params:oauth:token-type:access_token \
--data-urlencode subject_token="$BUILDKITE_JWT" \
--data-urlencode subject_token_type=urn:ietf:params:oauth:token-type:id_token | jq -r .access_token) We expect the value of 'argo-cd-cli' so the error message is particularly odd. staticClients:
- name: BK agents OIDC
id: argo-cd-cli
secret: bk-oidc-secret
public: true You mentioned above that something might be caching a token. I have restarted all our BK agent pods (they run in-cluster) and all of the argocd pods were new (including the dex server) from the 2.11 upgrade. However in the interests of science, I also restarted every argocd pod. Same result regardless; the CI pipeline is blocked and cannot authenticate. |
I tried 2.11 RC3 and i still see errors:
Dex pod's dex.yaml looks like the following:
|
@hc2p in your case the actual error is this: "failed to verify signature: failed to verify id token signature." I'd start searching for answers specific to that error message, I see a few examples with a quick Google. You can safely ignore this error, it's just a result of the audience check loop and is expected to fail:
|
Hi @crenshaw-dev, I hope you're doing well! I was wondering if the fix in this pull request might be backported to the v2.10.x release? I’m currently using If I’m reading the code correctly, it looks like it adds two allowed audiences by default in this section of the code. argo-cd/util/settings/settings.go Lines 1923 to 1925 in ebb92d8
Without the fix from the pull request, it seems like the warning log message will keep popping up. Similar to this issue, I'm seeing the warning message logged thousands of times per minute. Thanks a lot for your help! |
In one of our test clusters, I tried this dex.config: |
connectors:
- type: saml
id: okta
name: Okta
config:
clientID: argo-cd
cliClientID: argo-cd
ssoURL: https://<redacted>
redirectURI: <redacted>
...
|
@crenshaw-dev If it was once every few minutes sure, but it's multiple times per minute, per pod, and has an impact on logging costs, plus the extra noise in the logs makes troubleshooting more cumbersome. Is there no way to resolve this properly? An "expected" warning shouldn't exist if it's sole purpose is to cry wolf. |
@Invincibear the spurious warning is fixed in recent versions. |
Glad to hear, thanks. I realize now that OLM-deployed Argo CD isn't using the newest version. I'll have to investigate this myself.
|
I'm gonna close this, because the causes are various, and newer versions of Argo CD will produce much more precise/useful error messages. |
hey there @zswanson - were you able to resolve this issue? i'm trying to do something similar, where i'm using github actions oidc to exchange for a dex token for argocd MACHINE auth... |
Checklist:
argocd version
.Describe the bug
We did upgrade both our deployment of ArgoCD using in-house chart, and the image to latest
2.7.0
(then2.7.1.
) , and sinceargocd-server
is spamming with logs:We did rollbacked both chart and argocd version to previous, and warning is still present. Both logging through UI or CLI is working as well.
We are using Google authentication using Google groups through the dex, without any
allowedAudiences
configured, so we do expectargo-cd
being part of allowed audiences, according toargo-cd/util/settings/settings.go
Line 1754 in 064c8da
To Reproduce
Dex configuration:
Expected behavior
Without any allowed audience explicitely configured, we're expecting that
argo-cd
is allowed as one.Version
The text was updated successfully, but these errors were encountered: