WifiDOG是一個熱點系統(tǒng)管呵,包含了認證服務器和客戶端兩部分組成银舱,認證原理大體說下:
General Flow Description:
一般流程描述:
①The client does his initial request, as if he was already connected, (e.g.:http://www.6hl.cn)
客戶端發(fā)出初始化請求锚贱,比如訪問 www.6hl.cn 這個站點
②The Gateway's firewall rules mangle the request to redirect it to a local port on the Gateway. When that's the done, the Gateway provides an HTTP Redirect reply that contains the Gateway ID, Gateway FQDN and other informations
網(wǎng)關(guān)的防火墻規(guī)則將這個請求重定向到本地網(wǎng)關(guān)的端口上咖驮。當做完這個工作捍掺,網(wǎng)關(guān)提供一個HTTP重定向回復臣樱,包含了Gateway的ID靶擦,Gateway的FQDN以及其他的信息。
③The Client does his request to the Auth Server as specified by the Gateway, see Login Protocol
用戶向認證服務器發(fā)出認證請求
http://auth_server/login?
gw_id=[GatewayID, default: "default"]
gw_address=[GatewayAddress, internal IP of router]
gw_port=[GatewayPort, port that wifidog Gateway is listening on]
url=[user requested url]
④The Gateway replies with a (potentially custom) splash (login) page
網(wǎng)關(guān)返回一個(可以是自定義的)splash(也稱作“登錄”)頁面
⑤The Client provides his identification informations (username and password)
用戶提供他的憑據(jù)信息雇毫,比如用戶名和密碼
⑥Upon succesful authentication, the client gets an HTTP Redirect to the Gateway's own web server with his authentication proof (a one-time token),http://GatewayIP:GatewayPort/wifidog/auth?token=[authtoken]
成功認證的話玄捕,客戶端將會被重定向到網(wǎng)關(guān)的自己的web頁面上,并且?guī)в幸粋€ 認證憑據(jù)(一個一次性的token)棚放,內(nèi)容比如
http://GatewayIP:GatewayPort/wifidog/auth?token=[authtoken]
⑦The Client then connects to the Gateway and thus gives it his token
用戶就是用獲取到的憑據(jù)訪問網(wǎng)關(guān)
⑧The Gateway requests validation of the token from the Auth Server, see Client Protocol【見登錄心跳】
網(wǎng)關(guān)去認證服務器詢問token的有效性
⑨The Auth Server confirms the token
認證服務器確認token的有效性
①①The Gateway then sends a redirect to the Client to obtain the Success Page from the Auth Server, redirects tohttp://auth_server/portal/
網(wǎng)關(guān)發(fā)送重定向給客戶端枚粘,以從認證服務器上獲取 成功提示頁面,重定向到http://auth_server/portal/這個位置
①②The Auth Server notifies the Client that his request was successful
認證服務器通知客戶請求成功飘蚯,可以上網(wǎng)了馍迄。
本文由http://www.wifidog.pro/2015/02/11/wifidog%E5%8E%9F%E7%90%86%E5%8F%8A%E6%B5%81%E7%A8%8B.html整理編輯,轉(zhuǎn)載請注明出處