我有一个问题,我需要从登录 Web 服务获取 SSO 令牌,但我似乎无法获取它。当我发布 ajax 帖子时,它会返回登录网页的 html 代码。我试图搜索 stackoverflow 和谷歌的提示,但我什么也没得到。这是带有 web 服务的 java 函数文件,可以使用 url 调用,出于安全原因,我无法在此处发布。有人可以给我一个提示或更好的例子吗?
package lv.rtu.itd.mobile.api.v1.service;
public interface SecurityService {
/**
* Try to login and aquire SSO token.
*
* @param username - attribute identifying person. This might me UID, email, short UID, or other supported
* attribues.
* @param password - password of the user.
* @return SSO token identifying user's session or <code>null</code> in case of invalid credentials.
*/
String login(String username, String password);
/**
* Checks if there's a SSO session that can be identified by provided token.
*
* @param token - token of SSO session returned by {@link #login(String, String)};
* @return <code>true</code> if SSO session is valid, <code>false</code> otherwise.
*/
boolean isTokenValid(String token);
/**
* Tries to log out the user's SSO session with given token.
*
* @param token - token identifying user's SSO session.
*/
void logout(String token);
}