use of edu.uiuc.ncsa.security.delegation.token.TokenForge 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);
}
use of edu.uiuc.ncsa.security.delegation.token.TokenForge in project OA4MP by ncsa.
the class TokenTest method testToken.
@Test
public void testToken() throws Exception {
TokenForge tf = getTSProvider().getTokenForge();
System.out.println("AT = " + tf.getAccessToken());
System.out.println("AG = " + tf.getAuthorizationGrant());
System.out.println("V = " + tf.getVerifier());
}
Aggregations