Skip to content
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

Allow Keycloak's aud to accept the default value "account" in addition to ClientID. #21965

Open
kingbj940429 opened this issue Feb 24, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@kingbj940429
Copy link

kingbj940429 commented Feb 24, 2025

Summary

Keycloak currently only supports the ClientID as the audience.

However, the default audience for a Keycloak user is account.

It would be ideal if the audience could be received through a ConfigMap or a similar things.

Motivation

as you see, a keycloak default audience is account.

Image

However, a argocd-server only allows ClientID like below
argo-cd/util/settings/settings.go

func (a *ArgoCDSettings) OAuth2AllowedAudiences() []string {
	if config := a.oidcConfig(); config != nil {
		if len(config.AllowedAudiences) == 0 {
			allowedAudiences := []string{config.ClientID}
			if config.CLIClientID != "" {
				allowedAudiences = append(allowedAudiences, config.CLIClientID)
			}
			return allowedAudiences
		}
		return config.AllowedAudiences
	}
	if a.DexConfig != "" {
		return []string{common.ArgoCDClientAppID, common.ArgoCDCLIClientAppID}
	}
	return nil
}

If a Token has default aud like account, invoke failed to verify token error

Proposal

need to allow "account" as a default audience by either:

  • Using a ConfigMap or environment variables to dynamically retrieve the default audience.
  • If using Keycloak, implementing an if statement to explicitly allow "aud: account".
@kingbj940429 kingbj940429 added the enhancement New feature or request label Feb 24, 2025
@kingbj940429
Copy link
Author

Can I work this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant