3.4.4 认证
如果CPE没有用TLS认证,ACS必须用HTTP来认证CPE。如果TLS用来加密,ACS应该用基本认证。如果TLS没有用来做加密,ACS必须使用摘要认证。
CPE必须支持HTTP的基本和摘要认证。CPE通过提供的基本认证和摘要认证的有点来确定认证方案。如果使用TLS加密,CPE应该主动发送基本认证身份。
注意:身份验证需要发送一个初始消息(通常是一个Inform包,该包中包含RPC方法请求);当用TLS做加密时,主动发起一个基本认证可以避免额外的请求。
如果CPE已经接收到了来自于ACS的认证(基本或摘要),为了维持TCP连接,CPE必须发送在接下来的所有HTTP请求中发送认证头。无论CPE会不会这样做,ACS需要在会话的任意阶段在一个或多个TCP连接中发送认证。
如果任何形式的HTTP认证用来认证CPE,CPE需要用用户名/用户标识符,用户标识符是所有CPE制造商唯一的标志。
特别是,CPE的用户名/用户标识符应该是以下两种格式的其中一种:
If a username/userid of the above format is used, the
the DeviceIdStruct in the Inform message, as defined in Annex A, except that, in order to
guarantee that the Parameter values can be extracted from the username/userid, any
character in the
underscore (“_”) MUST be escaped using URI percent-encoding, as defined in RFC 3986
Percent-encoding MUST be performed by converting each character to UTF-8 and then
percent-encoding each octet. For example, the character é (LATIN SMALL LETTER E
WITH ACUTE) is represented in UTF-8 as the two octets 0xC3 0xA9 and so would be
percent-encoded as “%C3%A9”.
Note – prior to the clarification that conversion to UTF-8 occurs before percent-encoding, the
escaped username/userid was ambiguous. For example, an implementation might have treated the
character é as the ISO Latin-1 octet 0xE9, which would have been percent-encoded as “%E9”. (好像是格式之类的,以后翻译)