3

By default the CM_HOST value in the init.ps1 file of a XM Cloud project is set to xmcloud.localhost. I want to change this name to, for example xmcloudserge.loca.lt.

If I change the name I get a problem with the authentication from https://xmcloudserge.local.lt to sitecorecloud.io, which contains a hard reference to xmcloud.localhost as a return URL:

https://auth.sitecorecloud.io/authorize?client_id=we67e2gGRO0HIfglz23Yypp4T5Rshu86&response_type=code&scope=openid%20profile&state=OpenIdConnect.AuthenticationProperties%3DE7FEVVpMc5sJM8SLjOlOU_m73gkTqvOfFxs2LrcnaZdSrX3MRF_Q12ZyVDpbKIXZhDDWImasq51g1-y5BGIXOsq21vxGGb8FJjz12NttbaecPcQ8z9Kd0Fnrv5yZmRk0Fjf3TntIMUw2WT628TXtyfEeHhJ8gbaem0rO08GVln8TwzKDJR4qEg7nxqEbucvf7Bt1KMCg_FjD0VdxC2m1hq0WEZ5zfKLTTf_fYOg0-d0&response_mode=form_post&nonce=638012677311361499.Y2ZmMWYzMjUtNjRkZS00NDJjLWI0YzctZjZmZWNmOWUyZWRiZGIwZGE5NzEtNDYwMS00YmU0LWJlMzItZTU5MWVmNDc5MDBj&redirect_uri=https%3A%2F%2Fxmcloudcm.localhost%2Fidentity%2Fsignin-auth0&organization_id=&returnTo=https%3A%2F%2Fxmcloudcm.localhost%2Fsitecore&x-client-SKU=ID_NET461&x-client-ver=5.3.0.0

If I change the returnTo query-string parameter to https://xmcloudserge.local.lt I get the following error:

Callback URL mismatch.

The provided redirect_uri is not in the list of allowed callback URLs.

Please go to the Application Settings page and make sure you are sending a valid callback url from your application.

which sounds logical, because the return URL must be whitelisted.

The reason I want to do this is because I want the Sitecore container to be accessible to the outside world, for example by using a local tunnel with the tool localtunnel as follows:

lt --local-host xmcloudserge.loca.lt --port 443 --allow-invalid-cert --local-https -s xmcloudserge

Which should result in the URL https://xmcloudserge.loca.lt mapped to the same URL on my local machine.

Any ideas to accomplish this are greatly appreciated...

1
  • Why do you need the CM container to be accessible to the world?
    – Richard Seal
    Commented Oct 13, 2022 at 15:32

1 Answer 1

3

The short answer is no.

It is not possible to change the default url of xmcloudcm.localhost - this is a restriction as you expected, that the url must be whitelisted for the auth0 redirects. Because the authentication provider is hosted by Sitecore, it would not be scalable to add every combination of development url into the whitelist, so there is just this one that you can use for local development.

If you want to have an instance of XM Cloud exposed to the outside world, it would be better to create a new environment in your XM Cloud project and use that.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.