|
SupportsSession 参数允许请求之间的会话支持,且默认情况下设置为 true。如果不想支持请求之间的会话,则将其设置为 false。
|
方法
|
说明
|
---|---|
public boolean matchesAuthRequest(HttpServletRequest httpRequest)
throws AuthenticatorException, |
允许用户从作为 httpRequest 参数提供的入站身份验证请求获取信息。如需指定:用户可以处理请求,请返回 true,否则返回 false。如果返回值为 true,则 ThingWorx 运行时将调用身份验证方法 (见下文)。
|
//… make SSO call or other algorithm to determine userName public void authenticate(HttpServletRequest httpRequest, HttpServletResponse httpResponse) { // use validateThingworxUser to make sure the user is enabled and a Thingworx user AuthenticationUtilities.validateThingworxUser(userName); // Call setCredentials, so the Thingworx platform can provide the correct permissions and access to allowed content this.setCredentials(userName); } // … or if not using SSO, but providing username and password public void authenticate(HttpServletRequest httpRequest, HttpServletResponse httpResponse) { AuthenticationUtilities.validateCredentials(user, password); this.setCredentials(user, password); } |
对于仅提供用户名的身份验证策略 (例如,在单独的应用程序中完成用户身份验证的 SSO),请使用左侧列所示的第一组 "validate" 和 "setCredentials"。
对于提供用户名和密码的身份验证策略,请使用左侧列所示的第二组 "validate" 和 "setCredentials"。
|
public void issueAuthenticationChallenge(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
引发 AuthenticatorException
|
此方法不是始终必需的。但是,如果从身份验证方法引发异常,或者将 RequiresChallenge 标志设置为 true,则将调用 issueAuthenticationchallenge 方法。
|
|
此身份验证器是为未来版本而设计的,目前已被禁用。
|
|
此身份验证器是为未来版本而设计的,目前已被禁用。
|
|
默认情况下,所有身份验证器均处于禁用状态。
|