WifiDog 认证协议研究之 Auth Server

认证流程如下图:


认证流程详解:
1.Login登录(参照 login/index.php)
服务器验证后,Redirect to GW,携带 token
http://$_REQUEST[gw_address]:$_REQUEST[gw_port]/wifidog/auth?token=$token
2.Validation of ID
服务器返回 Status
Auth: 1
Messages: | 认证信息(如错误之类的消息)
common.php中有如下定义:
/* Constant shared with the gateway

  • NEVER edit these, as they mush match the C code of the gateway */
    define('ACCOUNT_STATUS_ERROR', -1);
    define('ACCOUNT_STATUS_DENIED', 0);
    define('ACCOUNT_STATUS_ALLOWED', 1);
    define('ACCOUNT_STATUS_VALIDATION', 5);
    define('ACCOUNT_STATUS_VALIDATION_FAILED', 6);
    define('ACCOUNT_STATUS_LOCKED', 254);

auth.h中也有相应定义:

/** 
  * @brief Authentication codes returned by auth server. 
  * 
  * Authentication result codes returned by auth_server_request() corresponding 
 * to result code from the central server itself. 
*/  
typedef enum {  
    AUTH_ERROR = -1, /**< An error occured during the validation process*/  
    AUTH_DENIED = 0, /**< Client was denied by the auth server */  
    AUTH_ALLOWED = 1, /**< Client was granted access by the auth server */  
    AUTH_VALIDATION = 5, /**< A misnomer.  Client is in 15 min probation to validate his new account */  
    AUTH_VALIDATION_FAILED = 6, /**< Client had X minutes to validate account by email and didn't = too late */  
    AUTH_LOCKED = 254 /**< Account has been locked */  
} t_authcode;  


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值