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

Make static clients' RedirectURIs to be regular expressions #1220

Closed
wants to merge 2 commits into from

Conversation

redbaron
Copy link

No description provided.

@redbaron redbaron force-pushed the upstream-redirect-uri-regex branch from 92cee75 to 726e471 Compare April 16, 2018 15:42
@@ -25,6 +26,9 @@ type staticClientsStorage struct {
func WithStaticClients(s Storage, staticClients []Client) Storage {
clientsByID := make(map[string]Client, len(staticClients))
for _, client := range staticClients {
if re, err := regexp.Compile("^" + strings.Join(client.RedirectURIs, "|") + "$"); err == nil {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regexp built here is missing a caption group over the joined RedirectURIs causing it to match two concatenated URIs.

Given two RedirectURIs http://foo.com and http://bar.com the compiled regex would look like

^http://foo.com|http.bar.com$

and it would match

http://foo.comhttp://bar.com

which doesn't look right to me.

Instead the regexp should look like ^(http://foo.com|http://bar.com)$

@JounQin
Copy link

JounQin commented Mar 27, 2020

Any news for this feature?

@ping-localhost
Copy link

Is there any chance this will ever be merged? It would be extremely useful.

@tom-haines
Copy link
Contributor

This would be a useful feature. In addition to google / azure supporting wildcards as discussed in #448, auth0 also has wildcard support.

@anagrius
Copy link

bump

@sergeyshevch
Copy link

@fbsb Can you look on it please?

@cdenneen
Copy link

Anyone have any luck on this?

@redbaron
Copy link
Author

I am not using dex anymore. If anyone is interested and thinking it is salvageable use this branch to open new PR rebased & refined.

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

Successfully merging this pull request may close these issues.

8 participants