1.6.2. 在服务器幻灯片中配置 SASL 身份验证机制
在服务器端配置 SASL 身份验证机制是使用 SASL 身份验证工厂完成的。
需要两个级别的配置:
-
sasl-authentication-factory
,您可在其中指定身份验证机制。 -
可配置-sasl-server-factory
,用于聚合一个或多个sasl-authentication-factory
,并配置机制属性,以及选择性应用过滤器来启用或禁用某些身份验证机制。
以下示例演示了创建新的 可配置-sasl-server-factory
和 sasl-authentication-factory
,它使用 DIGEST-MD5 作为应用客户端的 SASL 身份验证机制。
/subsystem=elytron/configurable-sasl-server-factory=mySASLServerFactory:add(sasl-server-factory=elytron) /subsystem=elytron/sasl-authentication-factory=mySASLAuthFactory:add(sasl-server-factory=mySASLServerFactory,security-domain=ApplicationDomain,mechanism-configurations=[{mechanism-name=DIGEST-MD5,mechanism-realm-configurations=[{realm-name=ApplicationRealm}]}])
/subsystem=elytron/configurable-sasl-server-factory=mySASLServerFactory:add(sasl-server-factory=elytron)
/subsystem=elytron/sasl-authentication-factory=mySASLAuthFactory:add(sasl-server-factory=mySASLServerFactory,security-domain=ApplicationDomain,mechanism-configurations=[{mechanism-name=DIGEST-MD5,mechanism-realm-configurations=[{realm-name=ApplicationRealm}]}])