Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

Service doesn't redirect to login page

Hi Community.

 

I'm having some problems with a Service installation.

Customer is using SO84R04, and is accessing web through a Reverse Proxy server.

 

When trying to access a Screen from Service, and I doesn't have a login token, I would expect to be redirected to the login page.

As an example, if you go to https://socrm.jfmedier.dk/Service/scripts/blogic.fcgi?_sf=0&action=doScreenDefinition&id=24

normally you would be redirected to the login page, but instead you're presented with a server 403 error.

 

This have a couple of follow-problems.

1) Can't access Service or Marketing from Windoes client. 

2) Can't show custom screens in windows application.

 

Do anyone have a suggestion what the problem can be? It works fine when logged into the web application.

RE: Service doesn't redirect to login page

Hei Kasper,

try moving this post to the Customer Service forum.
Web panels are black boxes for the Win team and I doubt the CS dudes take much notice this to forum :-)
/conrad

Af: Conrad Weyns 5. apr 2019

RE: Service doesn't redirect to login page

Moved to Customer Service

Af: Christian Mogensen 5. apr 2019

RE: Service doesn't redirect to login page

Hi Kasper,

does it work if you do this directly on the webserver, so that you don't go through the Reverse Proxy?

Seems like you've installed CRM on /Sales and Service on /Service, which is how SuperOffice describes it in the technical documentation. I think our consultants never started doing it that way. We put Service at the root, and install CRM in the default /SuperOffice path.

In your case, when you try to access anything in service without being authenticated, Service will return a 302 with a Location header telling your browser to go to 'https://socrm.jfmedier.dk/?service?%2FService%2Fscripts%2Frms.fcgi%3F_sf%3D&fromCs=1'.

That is not the correct path. It should have returned a Location header pointing to:

https://socrm.jfmedier.dk/Sale?service?%2FService%2Fscripts%2Frms.fcgi%3F_sf%3D&fromCs=1

which in turn gives you another 302 Redirect which tells your browser to go to 'https://socrm.jfmedier.dk:443/Sale/Security/Login.aspx?ReturnUrl=%2fSale%2f%3fservice%3f%252FService%252Fscripts%252Frms.fcgi%253F_sf%253D%26fromCs%3d1', where you get the login screen.

So the problem is somewhere with the first request telling the browser to go to / instead of /Sale. Exactly why that is, I'm not sure. It _could_ be the "Base URL for Web Client" preference being wrongly configured. Or it could be a bad rewrite rule in the Reverse Proxy.

When Service discovers that you are not logged in, it will redirect you "somewhere". Part of that somewhere is retrieved from the cookie called "crmUrl". And in your case, by manually adding/modifying the crmUrl cookie like this, it'll work:

Doing that will cause https://socrm.jfmedier.dk/Service/scripts/rms.fcgi to correctly redirect to the login page.

Exactly how Service determines to set that cookie, or what it does when the cookie isn't present, I'm not sure. Perhaps one of the Service guys can shed some light.

One other thing you should check out is that you should make sure there is a Default.htm file in the root of your webserver, so that any calls to https://socrm.jfmedier.dk/ gets redirected to https://socrm.jfmedier.dk/Sale. That might also fix the issue.

Af: Frode Lillerud 6. apr 2019

RE: Service doesn't redirect to login page

Thank you for moving my wrongly placed thread to the correct forum :).

@Frode: Yes, I'm using /sale and /service as paths. But I've done this many times before without any problems.

I've tried to access the URL from the proxy server, but I still get the same error.

Where is your first image from? Is it just from the inspect window somwhere?

 

Af: Kasper Rosenlund 8. apr 2019

RE: Service doesn't redirect to login page

Hi, the first image is from F12->Network in Chrome.

Af: Frode Lillerud 8. apr 2019

RE: Service doesn't redirect to login page

Thank you. Ill try to debug further.

But I don't think it has anything to do with the redirection from the proxyserver.

 

If anyone know exactly how Service get the url from the first request (see Frodes comment), please enlighten me :).

Af: Kasper Rosenlund 8. apr 2019

RE: Service doesn't redirect to login page

Hi,

There are various ways we try to get this path. There is a preference in the database which says where Sales is. I believe we cache it in a cookie. So try checking the preference, and then clear the cookie, and retry.

Sverre

Af: Sverre Hjelm 8. apr 2019

RE: Service doesn't redirect to login page

Also make sure the preference (BaseCRMUrl) has the correct protocol in front of if (http or https).

Af: Stian Andre Olsen 8. apr 2019

RE: Service doesn't redirect to login page

Hi all.,

For some reason the userpreference 'CRMBaseUrl' had the value 'https://socrm.jfmedier.dk'.

After correcting it to 'https://socrm.jfmedier.dk/sale' it seems to work.

Thank you!

Af: Kasper Rosenlund 8. apr 2019