December 17th Monday (十二月 十七日 月曜日)

typedef struct {
    /* For HTTP Basic Authentication
     * Given a username and password, expected to return AUTH_GRANTED
     * if we can validate this user/password combination.
     */
    authn_status (*check_password)(request_rec *r, const char *user, const char *password);

    /* For HTTP Digest Authentication
     * Given a user and realm, expected to return AUTH_USER_FOUND if we
     * can find a md5 hash of ‘user:realm:password'
     */
    authn_status (*get_realm_hash)(request_rec *r, const char *user,const char *realm, char **rethash);
} authn_provider;

  Whereas the first function check_password serves to verifya supplied passwordfor the username, the second serves only to look up an MD5 hash and return it
for mod_auth_digest to process.

Satisfy Any

  Determining Whether to Require Both or Just One of Host and User.

  The logic of the security phase in the Apache core is shown here, in pseudocode form:

If (Satisfy Any) {
  run access_checker
  if (allowed by access checker) {
    ALLOW access; skip check_user_id and auth_checker hooks
  } else {
    if (configured for authentication) {
      run check_user_id
      if (user id is valid) {
        run auth_checker; outcome is ALLOW or DENY
      } else {
        DENY access
      }
    }
  }
} else { /* Satisfy ALL is the default */
  run access_checker
  if (allowed by access checker) {
    if (configured for authentication) {
      run check_user_id
      if (user id is valid) {
        run auth_checker; outcome is ALLOW or DENY
      } else {
        DENY access
      }
    }
  } else {
    DENY access; skip check_user_id and auth_checker hooks
  }
}
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值