jelhub / scimgateway

Using SCIM protocol as a gateway for user provisioning to other endpoints
MIT License
176 stars 57 forks source link

Override base URL for metadata.location #110

Closed christinedraper closed 9 months ago

christinedraper commented 9 months ago

Is there any way to override the base URL for location in the response metadata? Our scim service is running in a k8s cluster behind a proxy, so the location should be the external endpoint (base URL + path). What we're getting is the internal service URL.

jelhub commented 9 months ago

Hi, Do your IdP make use of meta.location that is included in response? It's included because of SCIM specification, I'm not aware of IdP's actually using this information.

Assume reason for question is that you do not want to expose internal host/port information in response?

Two potential solutions to address this issue:

Regards, Jarle

christinedraper commented 9 months ago

The main concern is not exposing internal host info. Its reassuring that you're not aware of IDPs using the information. Either of the approaches you suggest would work for us, the first would be simpler to set up.

jelhub commented 9 months ago

Now fixed. Ref:

Change log

v4.4.4

[Added]

Below is an example of nginx reverse proxy configuration supporting SCIM Gateway ipAllowList and correct meta.location response:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $http_host;