Authentication WSO2检查用户是否经过身份验证,会话是否仍然有效

Authentication WSO2检查用户是否经过身份验证,会话是否仍然有效,authentication,wso2,jsessionid,Authentication,Wso2,Jsessionid,我使用WSO2 Identity Server 4.1.0提供的AuthenticationAdmin Web服务进行用户身份验证 通过webservice操作“login”,我可以对用户进行身份验证并检索JSESSIONID 创建的会话最终将超时。如何检查会话是否仍然有效 一些上下文(也用于检查我是否理解正确): 我正在运行一个不受WSO2服务器“保护”的辅助Web服务。我可以修改这个辅助Web服务,以便它可以检查用户是否已成功登录。但是我不知道怎么做。 因此,一旦检索到JSSessionID

我使用WSO2 Identity Server 4.1.0提供的AuthenticationAdmin Web服务进行用户身份验证

通过webservice操作“login”,我可以对用户进行身份验证并检索JSESSIONID

创建的会话最终将超时。如何检查会话是否仍然有效

一些上下文(也用于检查我是否理解正确): 我正在运行一个不受WSO2服务器“保护”的辅助Web服务。我可以修改这个辅助Web服务,以便它可以检查用户是否已成功登录。但是我不知道怎么做。
因此,一旦检索到JSSessionID,每次用户访问辅助web服务时,我都需要使用它。

如果我理解正确,您只需要为经过身份验证的用户授予访问web服务的权限

有许多方法可以保护web服务。由于您使用AuthenticationAdmin登录,因此可以将web服务定义为管理服务

我猜您正在尝试针对web服务的代码优先方法。您可以尝试将web服务扩展到org.wso2.carbon.core.AbstractAdmin

例如,我们可以在WSO2内核中看到UserAdmin服务

用户管理服务:

axis2 services.xml:

您可以在services.xml中看到以下属性

<parameter name="adminService" locked="false">true</parameter>
<parameter name="hiddenService" locked="false">true</parameter>
我希望这有帮助

谢谢

ServiceClient client = stub._getServiceClient();
Options option = client.getOptions();
option.setManageSession(true);
option.setProperty(org.apache.axis2.transport.http.HTTPConstants.COOKIE_STRING, cookie);