use of com.github.scribejava.core.builder.api.OAuth1SignatureType in project scribejava by scribejava.
the class OAuth10aService method appendSignature.
protected void appendSignature(OAuthRequest request) {
final OAuthConfig config = getConfig();
final OAuth1SignatureType signatureType = api.getSignatureType();
switch(signatureType) {
case Header:
config.log("using Http Header signature");
final String oauthHeader = api.getHeaderExtractor().extract(request);
request.addHeader(OAuthConstants.HEADER, oauthHeader);
break;
case QueryString:
config.log("using Querystring signature");
for (Map.Entry<String, String> oauthParameter : request.getOauthParameters().entrySet()) {
request.addQuerystringParameter(oauthParameter.getKey(), oauthParameter.getValue());
}
break;
default:
throw new IllegalStateException("Unknown new Signature Type '" + signatureType + "'.");
}
}
Aggregations