• 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

    • The Radeon RX 9060 XT is 5% slower than the GeForce RTX 5060 Ti, but the GeForce RTX 5060 Ti is 23% more expensive, at least when comparing MSRPs.
    • I would love to see Musk's face! 🤣🤣🤣
    • I think each AI option has their ups and downs. For Copilot, I find it more personable in how it talks compared to GPT & Gemini. I also appreciate the open ended questions it often provides at the end of its responses to keep the conversation going.
    • Microsoft offers free access to AI video creation with Bing Video Creator by Pradeep Viswanathan Two years ago, Bing Image Creator became one of the first major online services that allowed users to create images from text using OpenAI’s DALL-E model. Today, Microsoft is introducing Bing Video Creator, powered by OpenAI’s Sora, allowing users to create videos with text prompts. Despite announcing Sora last year, OpenAI has not been able to expand its availability to millions of ChatGPT users due to huge AI infrastructure requirements. It is still only available to ChatGPT Pro subscription users, which costs about $200 per month. Recently, Google announced its Veo 3 video generation model, which performs significantly better than OpenAI’s Sora, to all Gemini paid subscribers, making video generation accessible to even Gemini Pro subscribers, which costs just $20 per month. Now, Microsoft is democratizing access to video generation models by making Bing Video Creator free for all Bing users. Bing Video Creator is rolling out today globally (excluding China and Russia) on the Bing Mobile App, and it will be coming soon to the Bing desktop experience within Copilot Search. Bing Video Creator users will have the ability to choose between Fast and Standard generation speeds. Each user will have 10 Fast creations; following that, users can redeem 100 Microsoft Rewards points for each Fast creation or continue with Standard creation speeds. Once you have downloaded the Bing mobile app, here’s how you can access the Video Creator feature: Open Video Creator within the Bing Mobile app by clicking on the menu in the bottom right corner and selecting “Video Creator.” Just type in a text description of the video you want to create in the prompt box. Once the prompt text is ready, just tap “Create.” Or you can also just type directly into the Bing mobile app search bar "Create a video of..." to create a video. You’ll receive a notification when your video is ready to view. If required, you can also download the video or share it via social media or email. You will also have the ability to copy a direct link to the video for easy sharing elsewhere. Microsoft will be storing the generated videos for up to 90 days in your account for easy access later. Microsoft noted that the Bing Video Creator videos are 5 seconds long and can be created only in 9:16 format for now. Microsoft will be adding the 16:9 format soon. When you are waiting for your video to be created, you can also queue up another two videos. Once one of the slots becomes available, you can add another one to the queue. When Bing Video Creator becomes available on desktop, you can visit Bing.com/create for both image and video creation needs.
  • Recent Achievements

    • Week One Done
      Nullun earned a badge
      Week One Done
    • First Post
      sultangris earned a badge
      First Post
    • Reacting Well
      sultangris earned a badge
      Reacting Well
    • First Post
      ClarkB earned a badge
      First Post
    • Week One Done
      Epaminombas earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      150
    2. 2
      ATLien_0
      122
    3. 3
      Xenon
      121
    4. 4
      snowy owl
      99
    5. 5
      +Edouard
      94
  • Tell a friend

    Love Neowin? Tell a friend!