Examples of SessionToken


Examples of com.azwul.api.model.SessionToken

    String setCookie = httpResult.getHttpMethod()
        .getResponseHeader("Set-Cookie").getValue();

    httpResult.releaseConnection();

    SessionToken sessionToken = new SessionToken();
    sessionToken.setApiId(apiId);
    sessionToken.setCookie(setCookie);

    httpResult.setSessionToken(sessionToken);
    return isLogged(sessionToken);
  }
View Full Code Here

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

Examples of org.apache.lucene.replicator.SessionToken

        case RELEASE:
          replicator.release(extractRequestParam(req, REPLICATE_SESSION_ID_PARAM));
          break;
        case UPDATE:
          String currVersion = req.getParameter(REPLICATE_VERSION_PARAM);
          SessionToken token = replicator.checkForUpdate(currVersion);
          if (token == null) {
            resOut.write(0); // marker for null token
          } else {
            resOut.write(1); // marker for null token
            token.serialize(new DataOutputStream(resOut));
          }
          break;
      }
    } catch (Exception e) {
      resp.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); // propagate the failure
View Full Code Here

Examples of org.apache.lucene.replicator.SessionToken

        final DataInputStream dis = new DataInputStream(responseInputStream(response));
        try {
          if (dis.readByte() == 0) {
            return null;
          } else {
            return new SessionToken(dis);
          }
        } finally {
          dis.close();
        }
      }
View Full Code Here

Examples of org.apache.lucene.replicator.SessionToken

        final DataInputStream dis = new DataInputStream(responseInputStream(response));
        try {
          if (dis.readByte() == 0) {
            return null;
          } else {
            return new SessionToken(dis);
          }
        } finally {
          dis.close();
        }
      }
View Full Code Here

Examples of org.apache.lucene.replicator.SessionToken

        case RELEASE:
          replicator.release(extractRequestParam(req, REPLICATE_SESSION_ID_PARAM));
          break;
        case UPDATE:
          String currVersion = req.getParameter(REPLICATE_VERSION_PARAM);
          SessionToken token = replicator.checkForUpdate(currVersion);
          if (token == null) {
            resOut.write(0); // marker for null token
          } else {
            resOut.write(1); // marker for null token
            token.serialize(new DataOutputStream(resOut));
          }
          break;
      }
    } catch (Exception e) {
      resp.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR); // propagate the failure
View Full Code Here

Examples of org.teiid.client.security.SessionToken

  }

  public LogonResult logon(Properties connProps) throws LogonException,
      ComponentNotFoundException {
    DQPWorkContext workContext = DQPWorkContext.getWorkContext();
    SessionToken oldToken = workContext.getSessionToken();
        String applicationName = connProps.getProperty(TeiidURL.CONNECTION.APP_NAME);
        // user may be null if using trustedToken to log on
        String user = connProps.getProperty(TeiidURL.CONNECTION.USER_NAME, CoreConstants.DEFAULT_ANON_USERNAME);
        // password may be null if using trustedToken to log on
        String password = connProps.getProperty(TeiidURL.CONNECTION.PASSWORD);
    Credentials credential = null;
        if (password != null) {
            credential = new Credentials(password.toCharArray());
        }
       
        boolean adminConnection = Boolean.parseBoolean(connProps.getProperty(TeiidURL.CONNECTION.ADMIN));
    try {
      SessionMetadata sessionInfo = service.createSession(user,credential, applicationName, connProps, adminConnection, true);
          updateDQPContext(sessionInfo);
          if (DQPWorkContext.getWorkContext().getClientAddress() == null) {
        sessionInfo.setEmbedded(true);
          }
          if (oldToken != null) {
            try {
          this.service.closeSession(oldToken.getSessionID());
        } catch (InvalidSessionException e) {
        }
          }
      return new LogonResult(sessionInfo.getSessionToken(), sessionInfo.getVDBName(), sessionInfo.getVDBVersion(), clusterName);
    } catch (LoginException e) {
View Full Code Here

Examples of org.teiid.client.security.SessionToken

   
    if (sessionInfo == null) {
      throw new InvalidSessionException();
    }
   
    SessionToken st = sessionInfo.getSessionToken();
    if (!st.equals(checkSession)) {
      throw new InvalidSessionException();
    }
    this.updateDQPContext(sessionInfo);
  }
View Full Code Here

Examples of org.teiid.client.security.SessionToken

       
        long creationTime = System.currentTimeMillis();

        // Return a new session info object
        SessionMetadata newSession = new SessionMetadata();
        newSession.setSessionToken(new SessionToken(userName));
        newSession.setSessionId(newSession.getSessionToken().getSessionID());
        newSession.setUserName(userName);
        newSession.setCreatedTime(creationTime);
        newSession.setApplicationName(applicationName);
        newSession.setClientHostName(properties.getProperty(TeiidURL.CONNECTION.CLIENT_HOSTNAME));
View Full Code Here

Examples of org.teiid.client.security.SessionToken

      ClientServiceRegistryImpl server = new ClientServiceRegistryImpl();
      server.registerClientService(ILogon.class, new LogonImpl(mock(SessionService.class), "fakeCluster") { //$NON-NLS-1$
        @Override
        public LogonResult logon(Properties connProps)
            throws LogonException, ComponentNotFoundException {
          return new LogonResult(new SessionToken("dummy"), "x", 1, "z");
        }
       
        @Override
        public ResultsFuture<?> ping() throws InvalidSessionException,
            TeiidComponentException {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.