Created
February 20, 2013 18:35
-
-
Save bshaffer/4997860 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected String getSecurityHeader(String apiKey, String apiSecret, byte[] nonce, String username, String secret, String created) throws UnsupportedEncodingException { | |
String password64 = AuthenticationHelper.getBase64Digest(nonce, created.getBytes(), secret.getBytes()); | |
StringBuffer header = new StringBuffer(); | |
header.append("UsernameToken Username=\""); | |
header.append(username); | |
header.append("\", "); | |
header.append("PasswordDigest=\""); | |
header.append(password64.trim()); | |
header.append("\", "); | |
header.append("Nonce=\""); | |
header.append(AuthenticationHelper.base64Encode(nonce).trim()); | |
header.append("\", "); | |
header.append("Created=\""); | |
header.append(created); | |
header.append("\", "); | |
header.append("appkey=\""); | |
header.append(apiKey); | |
header.append("\", "); | |
header.append("appdigest=\""); | |
header.append(getAppPassword(apiSecret, nonce)); | |
header.append("\", "); | |
header.append("appnonce=\""); | |
header.append(AuthenticationHelper.base64Encode(nonce).trim()); | |
return header.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment