当前位置: 首页>>代码示例>>Java>>正文


Java SSOManager类代码示例

本文整理汇总了Java中org.sunbird.services.sso.SSOManager的典型用法代码示例。如果您正苦于以下问题:Java SSOManager类的具体用法?Java SSOManager怎么用?Java SSOManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SSOManager类属于org.sunbird.services.sso包,在下文中一共展示了SSOManager类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: verifyUserAccesToken

import org.sunbird.services.sso.SSOManager; //导入依赖的package包/类
/**
 * This method will verify the incoming user access token against store data base /cache. If token
 * is valid then it would be associated with some user id. In case of token matched it will
 * provide user id. else will provide empty string.
 * @param token String
 * @return String
 */
@SuppressWarnings("unchecked")
public static String verifyUserAccesToken(String token) {
  SSOManager ssoManager = SSOServiceFactory.getInstance();
  String userId = ""; 
  try { 
    boolean response = Boolean.parseBoolean(PropertiesCache.getInstance().getProperty(JsonKey.IS_SSO_ENABLED));
    if (response) {
    userId = ssoManager.verifyToken(token);
    } else {
     Response authResponse = cassandraOperation.getRecordById(userAuth.getKeySpace(), userAuth.getTableName(), token);
     if(authResponse != null && authResponse.get(JsonKey.RESPONSE) != null) {
      List<Map<String, Object>> authList =
           (List<Map<String, Object>>) authResponse.get(JsonKey.RESPONSE);
        if (authList != null && authList.size()>0) {
          Map<String,Object> authMap = authList.get(0);
           userId = (String) authMap.get(JsonKey.USER_ID);
        }
     }
    }
  } catch (Exception e) {
    ProjectLogger.log("invalid auth token =" + token, e);
  }
  return userId;
}
 
开发者ID:project-sunbird,项目名称:sunbird-lms-service,代码行数:32,代码来源:AuthenticationHelper.java

示例2: getLastLoginTime

import org.sunbird.services.sso.SSOManager; //导入依赖的package包/类
private String getLastLoginTime(String userId, String time) {
  String lastLoginTime = "0";
  if (Boolean.parseBoolean(PropertiesCache.getInstance().getProperty(JsonKey.IS_SSO_ENABLED))) {
    SSOManager manager = SSOServiceFactory.getInstance();
    lastLoginTime = manager.getLastLoginTime(userId);
  } else {
    lastLoginTime = time;
  }
  if (ProjectUtil.isStringNullOREmpty(lastLoginTime)) {
    return "0";
  }
  return lastLoginTime;
}
 
开发者ID:project-sunbird,项目名称:sunbird-lms-mw,代码行数:14,代码来源:UserManagementActor.java


注:本文中的org.sunbird.services.sso.SSOManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。