public HttpNxBasicHelper() { super( new ChallengeScheme( "HTTP_NxBasic", "NxBasic", "Nexus modified HTTP Basic" ), true, true ); }
/** * Returns the challenge scheme associated to a scheme name. If an existing * constant exists then it is returned, otherwise a new instance is created. * * @param name * The scheme name. * @return The associated challenge scheme. */ public static ChallengeScheme valueOf(final String name) { if (name == null) { throw new IllegalArgumentException( "ChallengeScheme.valueOf(name) name must not be null"); } ChallengeScheme result = SCHEMES.get(name.toLowerCase()); if (result == null) { result = new ChallengeScheme(name, null, null); } return result; }
// JSON payload and Content-Type header JSONObject jsonObj = (...) JsonRepresentation repr = new JsonRepresentation(jsonObj); // Authorization header String pAccessToken = "some token"; ChallengeResponse challengeResponse = new ChallengeResponse( new ChallengeScheme("", "")); challengeResponse.setRawValue(pAccessToken); resource.setChallengeResponse(challengeResponse); // Request and Accept header resource.post(jsonObj, MediaType.APPLICATION_JSON);
ChallengeResponse cred = new ChallengeResponse(new ChallengeScheme("","")); cred.setRawValue("12345");
result = POP_DIGEST; } else { result = new ChallengeScheme(name, null, null);
challengeScheme = new ChallengeScheme("HTTP_NXBASIC", "NxBasic", "Fake basic HTTP authentication");
String rawValue = header.substring(space + 1); result = new ChallengeResponse(new ChallengeScheme("HTTP_" + scheme, scheme)); result.setRawValue(rawValue);
challengeScheme = new ChallengeScheme( "HTTP_NXBASIC", "NxBasic", "Fake basic HTTP authentication" );
if (peek() != -1) { String scheme = readToken(); result = new ChallengeRequest(new ChallengeScheme("HTTP_" + scheme, scheme)); skipSpaces();