IEInternals

A look at Internet Explorer from the inside out. @EricLaw left Microsoft in 2012, but was named an IE MVP in '13 & an IE userAgent (http://useragents.ie) in '14

Detecting Captive Network Portals

Detecting Captive Network Portals

  • Comments 3

Over on SuperUser, there’s a great explanation of how Windows determines whether a newly-connected network has a proper Internet connection, or whether the user should open a browser to login or click through a Terms of Use agreement. The general idea is that Windows will attempt to download a webpage from a well-known URL, and if there were any errors or unexpected results, the user sees the prompt.

image

Read more about How Windows detects a Captive Network Portal.

Applications which want to make use of this information can use the Network List Manager API. There's a get_IsConnectedToInternet method on the INetwork interface and the captive portal flag can be found by looking at the VT_UINTs named NA_InternetConnectivityV4 and NA_InternetConnectivityV6 in the INetwork's property bag. If the flag NLM_INTERNET_CONNECTIVITY_WEBHIJACK is set, then a captive portal was detected.

-Eric

  • Interesting; Apple does this too, obviously.

    Any thoughts about the Captive Portals I-D?

    tools.ietf.org/.../draft-nottingham-http-portal-02

    Obviously, if you guys start supporting that status code, it'll encourage adoption by portals, but it sounds like it may not be necessary if every browser is going to take this approach, eventually.

  • Eric, I'm trying to use the Windows API Pack to detect the presence of a captive portal, I don't believe the interface is completelt implemented to allow me to do that, I have little experience in wrapping these interfaces into managed code, any pointers?

  • @JasonS: Have you looked at PInvoke.NET? If you can't find it there, email me.

Page 1 of 1 (3 items)
Leave a Comment
  • Please add 4 and 7 and type the answer here:
  • Post