You are not logged in.
I'm trying to connect to my University's WiFi labelled "Digital India" using nmcli. It connects, but I don't know where to type my user ID and password. I've tried to setup wpa_supplicant but had no luck with it.
Offline
Are we talking about a capitive portal? If so, open a web browser.
Offline
From what I can find "Digitial India" is a social/political program to ensure internet access is provided to certain targets - I can't find anything indicating that it relates to any specific implementation - so that's likely not relevant.
Most universities are now using eduroam (certainly those in the US, but I believe also common in the EU and in use in other areas) or at least similar systems. With wpa_supplicant, your user id and password would be in the wpa_supplicant.conf block for the ssid. There are examples in wpa_supplicant.conf.
But there are many different versions of this sort of connection. In theory you should be able to ask your institution's IT department for details on what is required - but in reality you generally just have to do a bit of trial and error ... or ask another linux user on the same network.
The scan results (e.g., from wpa_cli) will provide some useful information for what is required. Feel free to post the block for the relevant SSID if you want help deciphering it.
Last edited by Trilby (2022-03-27 15:34:24)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
So, I was able to connect to my Uni's Wifi by typying the login portal's page address (1.1.1.1/login.html) on my browser and entering in the required ID and password. However, I've to redo this process whenever I reconnect to this WiFi. Can I specify my user ID and Password in some config file so that this process happens automatically?
Offline
Ah, so it is just a captive portal. In that case, it can't really be automated with the typical networking tools. Though it can be scripted - e.g., I had a script a while back that used curl to log in to captive portals at a well known chain of coffee shops.
I suspect there likely are some more well-polished tools to handle more general cases of this. capnet-assist in [community] seems to be one such tool, though I know nothing about it other than what I learned from a glance at their website after finding it with `pacman -Ss captive portal`.
EDIT: actually capnet-assist may not actually do that much - it looks like it just opens a browser giving you the opportunity to log in with your credentials. Perhaps writing your own script with curl is the best approach to automating the login.
EDIT 2: in hindsight, it's unlikely that there are general purpose tools for this for reasons touched on below. It would be really cool if there was, but I'm not really sure how they could work (short of a pretty elaborate AI system).
Last edited by Trilby (2022-03-29 14:40:17)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
If it is possibe, can you provide me with a sample of your script. It'll assist me on writing my own script as I'm new to this thing.
Offline
https://bbs.archlinux.org/viewtopic.php … 2#p1823592 - not sure how much he automatized that afterwards.
There's no generic answer to that problem - you need to track what the captive portal does (in the most naive case it just posts your credentials to a url) and imitate that w/ eg. curl.
You'd fetch 1.1.1.1/login.html (or probably any page since that's really cloudflare and will get you a 301) and grep it for a pattern on whether it's the captive portal. If so <do captive portal action>
Offline
Yup, see above. This varies from case to case - and I don't actually have my script anymore. Most of the work in my script was due to just how out-of-the-ordinary starbucks' system is/was. Perhaps this is why capnet-assist just opens a browser and lets you handle it from there: while automating any specific captive portal implementation should not be that hard, there is no way to really anticipate all the possible ways it could be implemented to have a reasonable general-purpose automation tool.
For some captive portal implementations the script might be able to be pretty simple, perhaps even with a single `curl` command with parameters to send a POST request with your username and password in the posted data fields. But if you don't have a bit of scripting experience, and a bit more web-coding experience, then this is certainly not a trivial task.
If you want help "decoding" what needs to be done in your case, the first step would be to grab the html of the captive portal page. You could do this with a "view source" function in your browser on that page, or trying to curl from a url should return the same code on the command line (not-withstanding the fact that some captive portals actually only respond to specific urls ... most redirect "google.com" though, so that's where I tend to start).
Last edited by Trilby (2022-03-29 14:42:38)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline