Package com.khs.sherpa.json.service

Examples of com.khs.sherpa.json.service.SessionToken


  protected Object processAuthenication() throws SherpaRuntimeException {
    String userid = request.getParameter("userid");
    String password = request.getParameter("password");
    try {
      Authentication authentication = new Authentication(applicationContext);
      SessionToken token = authentication.authenticate(userid, password, request, response);
     
      boolean hasAdminRole = applicationContext.getManagedBean(SessionTokenService.class)
        .hasRole(token.getUserid(), token.getToken(), (String) applicationContext.getAttribute(ApplicationContext.SETTINGS_ADMIN_USER));
     
      // load the sherpa admin user
      if(hasAdminRole) {
        String[] roles = token.getRoles();
        token.setRoles(Util.append(roles, "SHERPA_ADMIN"));
      }
      return token;
    } catch (NoSuchManagedBeanExcpetion e) {
      throw new SherpaRuntimeException(e);
    }
View Full Code Here

TOP

Related Classes of com.khs.sherpa.json.service.SessionToken

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.