Leaving Redirect URIs/Origins (RegEx) blank fills in non-regex URI
Describe the bug In versions before authentik 2022.7, leaving Redirect URIs/Origins (RegEx) in provider settings blank, filled in the URI correctly, using RegEx, which was introduced some versions ago. Starting from authentik 2022.7, URI is filled with non-regex, which leads to errors: "The request fails due to a missing, invalid, or mismatching redirection URI (redirect_uri)"
To Reproduce Steps to reproduce the behavior:
- Log in as admin
- Go to Applications -> Providers
- Modify an OAuth2/OpenID Provider
- Clear "Redirect URIs/Origins (Regex)"
- Let authentik fill it again automatically with logging in into the application
- You'll see a URI there now, but with non-regex formatting
Expected behavior The URI should be regex formatted
Version and Deployment (please complete the following information):
- authentik version: 2022.7.2
- Deployment: docker-compose
Additional context Did work in versions before 2022.7
Same here
Starting with 2022.7 if a redirect URL can't be parsed as regex it's compared directly as it was in previous versions, https://github.com/goauthentik/authentik/commit/0cad56ec73044d003b0a88997d337d97747d5918
That sounds great, but unfortunately this does not work. Because leaving URI blank and then trying to log in leads to an error: The request fails due to a missing, invalid, or mismatching redirection URI (redirect_uri)
It'll try to compare with regex and if the configured redirect_uri is not a valid regex, then it does strict comparison, if it can be interpreted as regex and doesn't match then you'll get the error
It seems to use strict comparison (because it was not automatically regex-formatted) and the URI should definitely match. But the main issue, the automatic URI "detection", is still there and does not work as it did before.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.