gravitee-io / issues

Gravitee.io - API Platform - Issues
65 stars 26 forks source link

[management] invalid URL for pre registered user #6921

Open leleueri opened 2 years ago

leleueri commented 2 years ago

When a user is created as pre registered the link provided into the email contains invalid characters.

https://auth.mycompany.com/jdbc-psql *(/%7C$)(.)** /domain-jdbc/confirmRegistration?token=eyJraWQiOiJkZWZ...

Expected Behavior

The link should be valid and redirect to the confirm Registration page when the user click on it.

Current Behavior

The link contains invalid characters and the user is redirected to the No security domain matches the request URI. error page

Steps to Reproduce (for bugs)

  1. create a user with pre register toggle set to true
  2. click on the link provided by the confirm registration email
  3. No security domain matches the request URI. is display

Your Environment

leleueri commented 2 years ago

This seems to be related to the ingress configuration since this issues doesn't exist to another environment.

Working setting:

gateway:
  ingress:
    path: /
    hosts:
      - am.domain.net
    tls:
      - hosts:
        - am.domain.net
        secretName: cloud-gravitee-cert

not working setting:

  ingress:
    path: /jdbc-psql(/|$)(.*)
    hosts:
      - am.domain.net
    tls:
      - hosts:
        - am.domain.net
        secretName: cloud-gravitee-cert
    annotations:
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/rewrite-target: /$2
      nginx.ingress.kubernetes.io/use-regex: true
      nginx.ingress.kubernetes.io/configuration-snippet: |
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Host $server_name;
        proxy_set_header   X-Forwarded-Prefix /jdbc-psql;
        proxy_set_header   X-Forwarded-Proto $scheme;
leleueri commented 2 years ago

Problem comes from the gateway.url entry into the gravitee.yaml file. This entry is initialized by the gateway.ingress.pathinto the values.yaml of the helm chart. If we want to use path prefix with regex in order to rewrite the path, the regex is set into the gravitee.yaml