DNNCommunity / DNN.ActiveDirectory

Active Directory authentication for DNN
MIT License
26 stars 22 forks source link

Too many redirects #47

Closed westechms closed 6 years ago

westechms commented 6 years ago

From @ghkamfung Something like this: http://10.145.2.77/?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0?portalid=0

westechms commented 6 years ago

From @mortezakermani I'm having the same issue in DNN 9.2.0.

there are a lot of ?portal=0 parameters in url and site breaks

The last version of Active Directory worked for me is 05.00.02. no other versions work correctly.

westechms commented 6 years ago

I have seen this in production rarely. When I do see it, a refresh always makes it go away.

I need as many details as you can possible supply to track down the issue.
What do your config settings look like?
Did you try 5.00.02 on DNN 9.2.0 successfully? Are you trying to do autologin?

I will do my best to help!

mortezakermani commented 6 years ago

Yes, version 05.00.02 is works properly on DNN 9.2.0.

attached you can find my settings:

active

westechms commented 6 years ago

I think I have it already narrowed down. I suspect that its the auto-login ip address. I am refactoring to allow more situations. Can you try adding an IP range in the autologin ip field that would include the client IP you are using? Please report your results.

If your client IS the web server also (localhost) then there is a Microsoft problem related to that I will address later. But please report if this is the situation also.

ghkamfung commented 6 years ago

I tried both "Auto-login" and no "Auto-login". Same result. I tried to debug. It seems it cannot detect the cookie created by previous request/response cycle and keep thinking the user is not login.

Just my 2 cents.

Off topic, can someone share v5.0.0.2 to me?

ghkamfung commented 6 years ago

I install v5.0.0.6 .

  1. Login successful on first attempt. (My website is http://10.145.2.77, not using domain name yet)
  2. Logout
  3. Re-login using the same user, it fail (top-right hand corner still show "Login" link). The URL become http://10.145.2.77/Default.aspx?tabid=20&error=An%20unexpected%20error%20has%20occurred
westechms commented 6 years ago

I have an update coming soon that should get this fixed. It appears the redirect problem will arise if you do not have an IP in the auto-login box. I you add a range such as 1.1.1.1-255.255.255.255 then the redirect problem should go away.

ghkamfung commented 6 years ago

We add a checking, if "portalid=0" exists in query string, then do not redirect. It seems to fix the problem.

mortezakermani commented 6 years ago

Thanks a lot @ghkamfung. may you release a new version in this week?

westechms commented 6 years ago

I should have a new version out this week with the fix. Its complete I just need to clean up the code some. @ghkamfung its proper for the url to contain 1 portalid=0 and this will break again on a different portal of the same DNN instance as its portal id will be something other than 0. It should get you by though until I can get this update out.

sawest commented 6 years ago

@ghkamfund and @mortezakermani Please try the new release 6.1.2 as it should have this bug fixed. Be sure to utilize the new Enable Auto Login setting feature.

ghkamfung commented 6 years ago

v6.1.2 vIt works for us! Thank you very much.

sawest commented 6 years ago

Excellent. Thanks for the feed back.