Fixed detection of authentication method in server with permanent redire...

...ction