• 0

Determining if Kerberos auth would be successful using JavaScript


Question

Hi guys,

I have the following scenario: The user requests a web page. He is redirected to a landing page which should determine if the user can successfully authenticate using a Kerberos ticket. If he can, then he should be redirected to his originally requested page. If he can't, I do not wish the user to see the regular browser credentials window, but instead be redirected to a log-in page (after which he will be redirected to his originally requested page).

Any idea how I can test in JS if authentication would be successful and then make the decision then?

Any other ideas would be welcome as well. My server-side will be written in PHP.

Thanks,

6 answers to this question

Recommended Posts

  • 0
  On 25/07/2011 at 07:57, DerpDerp said:

Hi guys,

I have the following scenario: The user requests a web page. He is redirected to a landing page which should determine if the user can successfully authenticate using a Kerberos ticket. If he can, then he should be redirected to his originally requested page. If he can't, I do not wish the user to see the regular browser credentials window, but instead be redirected to a log-in page (after which he will be redirected to his originally requested page).

Any idea how I can test in JS if authentication would be successful and then make the decision then?

Any other ideas would be welcome as well. My server-side will be written in PHP.

Thanks,

You can use JQuery/Ajax and run the PHP script. If successful do one thing if not do another and you can do this JQuery callback

You can use these:

http://api.jquery.com/jQuery.get/

http://api.jquery.com/jQuery.post/

http://api.jquery.com/jQuery.ajax/

  • 0

Thanks for your answer!

Would a XMLHttpRequest suffice?

But correct me if I'm wrong, aren't these HTTP authentications a little ping-pong game? 401 first, then retry then so and so on. Wouldn't the AJAX request stop and fail on the first 401?

Thanks,

  • 0
  On 26/07/2011 at 08:28, C:Amie said:

You need to catch the status code back from the XMLHttpRequest before you execute your client code against the return value (i.e. look for a 200 code). You need to add handlers for other relevant status codes.

Yes, but would catching the initial return code not yield the initial 401 before the ping-pong of authentication (in my case either Kerberos or NTLM)?

  • 0

The web server shouldn't return from its script process until it has an authentication decision. If for some reason you have an asynchronous kerberos proces going on, you'll just have to re-send the request on receipt of a 401 with a longer wait timer defined at the server

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • RoboForm 9.7.5 by Razvan Serea RoboForm is the top-rated Password Manager and Web Form Filler that completely automates password entering and form filling. RoboForm makes logging into Web sites and filling forms faster, easier, and more secure. RoboForm memorizes and securely stores each user name and password the first time you log into a site, then automatically supplies them when you return. RoboForm's powerful Logins feature eliminates the manual steps of logging into any online account. With just one click RoboForm will navigate to a Web site, enter your username and password and click the submit button for you. Completing long registration or checkout forms is also a breeze. Simply click on your RoboForm Identity and RoboForm fills-in the entire form for you. You no longer need to remember all your passwords. You remember one Master Password, and RoboForm remembers the rest. This allows you to use stronger passwords, making your online experience more secure. RoboForm uses strong AES encryption for complete data security. The all new RoboForm comes with Chrome and Safari browser support, iPhone/iPad and Android support, as well a brand new RoboForm Everywhere license for use on unlimited computers and mobile devices. RoboForm 9.7.5 changelog: Prepared for the upcoming RoboForm browser extension with New Auth. Download: RoboForm 9.7.5 | 42.1 MB (Free, paid upgrade available) View: RoboForm Website Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • NTLite 2025.06.10460 is out.
    • I understand. I am not talking about benchmarks at all, even though I probably should look into those too - I just mean historically Vivaldi was a rather sluggish chromium browser when in use compared to other chromium browsers. I am always willing to give it additional tries whenever performance improvements are mentioned in the patch notes.
    • First make whole system slow and now making it fast. That's your own doing-undoing !!
  • Recent Achievements

    • One Year In
      Vladimir Migunov earned a badge
      One Year In
    • One Month Later
      daelos earned a badge
      One Month Later
    • Week One Done
      daelos earned a badge
      Week One Done
    • Mentor
      Karlston went up a rank
      Mentor
    • One Month Later
      EdwardFranciscoVilla earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      493
    2. 2
      snowy owl
      252
    3. 3
      +FloatingFatMan
      250
    4. 4
      ATLien_0
      225
    5. 5
      +Edouard
      180
  • Tell a friend

    Love Neowin? Tell a friend!