Package com.kolich.havalo.exceptions.authentication

Examples of com.kolich.havalo.exceptions.authentication.BadCredentialsException


            // Compute the resulting signed signature.
            final String computed = HMACSHA256Signer.sign(userKp, stringToSign);
            // Does the signature match what was passed to us in the
            // Authorization request header?
            if(!computed.equals(signature)) {
                throw new BadCredentialsException("Signatures did not " +
                    "match (request=" + signature + ", computed=" + computed +
                    ")");
            }
            // Success!
            request.setAttribute(HAVALO_AUTHENTICATION_ATTRIBUTE, userKp);
View Full Code Here


    // HTTP-Verb (GET, PUT, POST, or DELETE) + "\n"
    sb.append(request.getMethod().toUpperCase()).append(LINE_SEPARATOR_UNIX);
    // RFC822 Date (from 'Date' request header, must exist) + "\n" +
    final String dateHeader;
    if((dateHeader = request.getHeader(DATE)) == null) {
      throw new BadCredentialsException("Incoming request missing " +
        "required '" + DATE + "' request header.");
    }
    sb.append(dateHeader).append(LINE_SEPARATOR_UNIX);
    // Content-Type (from 'Content-Type' request header, optional) + "\n" +
    final String contentType;
View Full Code Here

TOP

Related Classes of com.kolich.havalo.exceptions.authentication.BadCredentialsException

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.