Examples of AuthenticateResponse


Examples of org.apache.james.imap.message.response.AuthenticateResponse

            } else {
                if (request instanceof IRAuthenticateRequest) {
                    IRAuthenticateRequest irRequest = (IRAuthenticateRequest) request;
                    doPlainAuth(irRequest.getInitialClientResponse(), session, tag, command, responder);
                } else {
                    responder.respond(new AuthenticateResponse());
                    session.pushLineHandler(new ImapLineHandler() {
               
                        public void onLine(ImapSession session, byte[] data) {
                            // cut of the CRLF
                            String initialClientResponse = new String(data, 0, data.length - 2, Charset.forName("US-ASCII"));
View Full Code Here

Examples of org.apache.james.imap.message.response.AuthenticateResponse

            } else {
                if (request instanceof IRAuthenticateRequest) {
                    IRAuthenticateRequest irRequest = (IRAuthenticateRequest) request;
                    doPlainAuth(irRequest.getInitialClientResponse(), session, tag, command, responder);
                } else {
                    responder.respond(new AuthenticateResponse());
                    session.pushLineHandler(new ImapLineHandler() {
               
                        public void onLine(ImapSession session, byte[] data) {
                            // cut of the CRLF
                            String initialClientResponse = new String(data, 0, data.length - 2, Charset.forName("US-ASCII"));
View Full Code Here

Examples of org.platformlayer.auth.model.AuthenticateResponse

          }
        });
        return;
      }

      AuthenticateResponse authenticateResponse = loginService.authenticate(httpRequest, request);
      if (authenticateResponse == null) {
        limits.recordFail(httpRequest, username);

        httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);
        return;
View Full Code Here

Examples of org.platformlayer.auth.model.AuthenticateResponse

  KeystoneUserAuthenticator userAuthenticator;

  public static final TimeSpan OVER_LIMIT_DELAY = TimeSpan.fromMilliseconds(2000);

  public AuthenticateResponse authenticate(HttpServletRequest httpRequest, AuthenticateRequest request) {
    AuthenticateResponse response = new AuthenticateResponse();

    String username = null;

    UserEntity user = null;
View Full Code Here

Examples of org.platformlayer.auth.v1.AuthenticateResponse

    PasswordCredentials passwordCredentials = new PasswordCredentials();
    passwordCredentials.setUsername(username);
    passwordCredentials.setPassword(password);

    // TODO: Cache auth tokens??
    AuthenticateResponse response = keystoneUserClient.authenticate(passwordCredentials);
    PlatformlayerAuthenticationToken authToken = new PlatformlayerAuthenticationToken(response.getAccess());

    return authToken;

    // // TODO: Cache decoded tokens?
    // KeystoneAuthentication auth = (KeystoneAuthentication) keystoneSystemClient.validate(
View Full Code Here

Examples of org.platformlayer.auth.v1.AuthenticateResponse

    auth.setPasswordCredentials(passwordCredentials);

    AuthenticateRequest request = new AuthenticateRequest();
    request.setAuth(auth);

    AuthenticateResponse response;
    try {
      response = doSimpleXmlRequest(HttpMethod.POST, "api/tokens", request, AuthenticateResponse.class);
    } catch (RestClientException e) {
      Integer httpResponseCode = e.getHttpResponseCode();
      if (httpResponseCode != null && httpResponseCode == 401) {
View Full Code Here

Examples of org.platformlayer.auth.v1.AuthenticateResponse

    request.setAuth(auth);

    final KeyManager keyManager = new SimpleClientCertificateKeyManager(privateKey, certificateChain);

    for (int i = 0; i < 2; i++) {
      AuthenticateResponse response;
      try {
        RestfulRequest<AuthenticateResponse> httpRequest = httpClient.buildRequest(HttpMethod.POST,
            "api/tokens", HttpPayload.asXml(request), AuthenticateResponse.class);

        httpRequest.setKeyManager(keyManager);

        response = httpRequest.execute();
      } catch (RestClientException e) {
        throw new PlatformlayerAuthenticationClientException("Error authenticating", e);
      }

      if (i == 0) {
        if (response == null || response.getChallenge() == null) {
          return null;
        }

        byte[] challenge = response.getChallenge();
        byte[] challengeResponse = decrypt(privateKey, challenge);
        certificateCredentials.setChallengeResponse(challengeResponse);
      } else {
        if (response == null || response.getAccess() == null) {
          return null;
        }
        return new PlatformlayerAuthenticationToken(response.getAccess());
      }
    }

    return null;
  }
View Full Code Here

Examples of org.platformlayer.auth.v1.AuthenticateResponse

    if (token == null) {
      PasswordCredentials passwordCredentials = new PasswordCredentials();
      passwordCredentials.setUsername(username);
      passwordCredentials.setPassword(password);

      AuthenticateResponse response = client.authenticate(passwordCredentials);
      token = new PlatformlayerAuthenticationToken(response.getAccess());
    }
    return token;
  }
View Full Code Here

Examples of uk.org.woodcraft.bookings.soap.jaxws.AuthenticateResponse

 
  public SOAPMessage handleSOAPRequest(SOAPMessage request) throws SOAPException {
      SOAPBody soapBody = request.getSOAPBody();
      @SuppressWarnings("rawtypes")
    Iterator iterator = soapBody.getChildElements();
      AuthenticateResponse authResponse = null;
      Object responsePojo = null;
     
      while (iterator.hasNext()) {
        Object next = iterator.next();
        if (next instanceof SOAPElement) {
          SOAPElement soapElement = (SOAPElement) next;
          QName qname = soapElement.getElementQName();
            if (AUTHENTICATE_QNAME.equals(qname)) {
              authResponse = handleAuthRequest(soapElement);
              break;
            } else if (MYVILLAGE_SIGNUP_QNAME.equals(qname)) {
              responsePojo = handleMyVillageSignupRequest(soapElement);
              break;
            }
        }
      }
     
      SOAPMessage soapResponse = messageFactory.createMessage();
      soapBody = soapResponse.getSOAPBody();
     
      if (authResponse == null)
      {
        SOAPFault fault = soapBody.addFault();
        fault.setFaultString("Missing authetication data");
        return soapResponse;
       
      } else if (!authResponse.isReturn())
      {
        SOAPFault fault = soapBody.addFault();
        fault.setFaultString("Failed authentication");
        return soapResponse;
      }
View Full Code Here

Examples of uk.org.woodcraft.bookings.soap.jaxws.AuthenticateResponse

    String apiUsername = request.getUsername();
    String apiPassword = request.getPassword();
   
    boolean success = api.authenticate(apiSitekey, apiUsername, apiPassword);
   
    AuthenticateResponse response = new AuthenticateResponse();
    response.setReturn(success);
    return response;
  }
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.