use of edu.uiuc.ncsa.security.oauth_1_0a.client.OAClient in project OA4MP by ncsa.
the class ClientLoader method createInstance.
@Override
public T createInstance() {
Provider<TokenForge> tokenForgeProvider = new Provider<TokenForge>() {
@Override
public TokenForge get() {
return new OAuthTokenForge(getId());
}
};
Provider<Client> clientProvider = new Provider<Client>() {
@Override
public Client get() {
OAClient c = new OAClient(BasicIdentifier.newID(getId()));
c.setSignatureMethod(OAuthConstants.RSA_SHA1);
c.setCreationTS(new Date());
return c;
}
};
// sets constants specific to this protocol.
HashMap<String, String> constants = new HashMap<String, String>();
constants.put(CALLBACK_URI_KEY, OAuthConstants.OAUTH_CALLBACK);
constants.put(ClientEnvironment.FORM_ENCODING, "UTF-8");
constants.put(ClientEnvironment.TOKEN, OAuth.OAUTH_TOKEN);
constants.put(ClientEnvironment.VERIFIER, OAuth.OAUTH_VERIFIER);
return createInstance(tokenForgeProvider, clientProvider, constants);
}
Aggregations