Search in sources :

Example 6 with OA4MPIdentifierProvider

use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider in project OA4MP by ncsa.

the class ClientManagerTest method testApproveSerialization.

@Test
public void testApproveSerialization(ClientStore clientStore) throws Exception {
    JSONObject request = new JSONObject();
    JSONObject requestContent = new JSONObject();
    OA2ClientProvider clientProvider = new OA2ClientProvider(new OA4MPIdentifierProvider(OA4MPIdentifierProvider.CLIENT_ID));
    OA2ClientConverter converter = new OA2ClientConverter(clientProvider);
    JSONObject jsonClient = new JSONObject();
    converter.toJSON(getOa2Client(clientStore), jsonClient);
    requestContent.put(KEYS_SUBJECT, jsonClient);
    JSONObject action = new JSONObject();
    action.put("type", "client");
    action.put("method", ACTION_APPROVE);
    requestContent.put(KEYS_ACTION, action);
    JSONObject jsonClient2 = new JSONObject();
    converter.toJSON(getOa2Client(clientStore), jsonClient2);
    requestContent.put(KEYS_TARGET, jsonClient2);
    request.put(KEYS_API, requestContent);
}
Also used : OA4MPIdentifierProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider) JSONObject(net.sf.json.JSONObject) OA2ClientProvider(edu.uiuc.ncsa.security.oauth_2_0.OA2ClientProvider) OA2ClientConverter(edu.uiuc.ncsa.security.oauth_2_0.OA2ClientConverter) Test(org.junit.Test)

Example 7 with OA4MPIdentifierProvider

use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider in project OA4MP by ncsa.

the class OA2ConfigurationLoader method getTSP.

@Override
protected Provider<TransactionStore> getTSP() {
    IdentifiableProvider tp = new ST2Provider(new OA4MPIdentifierProvider(TRANSACTION_ID, false));
    OA2TransactionKeys keys = new OA2TransactionKeys();
    OA2TConverter<OA2ServiceTransaction> tc = new OA2TConverter<OA2ServiceTransaction>(keys, tp, getTokenForgeProvider().get(), getClientStoreProvider().get());
    return getTSP(tp, tc);
}
Also used : OA4MPIdentifierProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider) OA2ServiceTransaction(edu.uiuc.ncsa.myproxy.oa4mp.oauth2.OA2ServiceTransaction) IdentifiableProvider(edu.uiuc.ncsa.security.core.IdentifiableProvider)

Example 8 with OA4MPIdentifierProvider

use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider in project OA4MP by ncsa.

the class ServiceConfigTest method testClientStoreProvider.

/**
 * Just reads in the configuration and calls "get" on the provider. This should work if the
 * configuration file is read.
 * @throws Exception
 */
@Test
public void testClientStoreProvider() throws Exception {
    ConfigurationNode cn = getConfig("mixed config");
    ClientProvider clientProvider = new ClientProvider(new OA4MPIdentifierProvider(OA4MPIdentifierProvider.CLIENT_ID));
    MultiDSClientStoreProvider csp = new MultiDSClientStoreProvider(cn, true, new MyLoggingFacade("test"), null, null, clientProvider);
    ClientConverter converter = new ClientConverter(clientProvider);
    csp.addListener(new DSFSClientStoreProvider(cn, converter, clientProvider));
    csp.addListener(new DSClientSQLStoreProvider(cn, new MySQLConnectionPoolProvider("oauth", "oauth"), MYSQL_STORE, converter, clientProvider));
    csp.addListener(new DSClientSQLStoreProvider(cn, new PGConnectionPoolProvider("oauth", "oauth"), POSTGRESQL_STORE, converter, clientProvider));
    ClientStore<Client> cs = (ClientStore<Client>) csp.get();
}
Also used : MultiDSClientStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientStoreProvider) ClientConverter(edu.uiuc.ncsa.security.delegation.storage.impl.ClientConverter) PGConnectionPoolProvider(edu.uiuc.ncsa.security.storage.sql.postgres.PGConnectionPoolProvider) ClientProvider(edu.uiuc.ncsa.security.delegation.storage.ClientProvider) DSFSClientStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider) MyLoggingFacade(edu.uiuc.ncsa.security.core.util.MyLoggingFacade) MySQLConnectionPoolProvider(edu.uiuc.ncsa.security.storage.sql.mysql.MySQLConnectionPoolProvider) ClientStore(edu.uiuc.ncsa.security.delegation.server.storage.ClientStore) DSClientSQLStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.sql.provider.DSClientSQLStoreProvider) OA4MPIdentifierProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider) ConfigurationNode(org.apache.commons.configuration.tree.ConfigurationNode) Client(edu.uiuc.ncsa.security.delegation.storage.Client) ConfigTest(edu.uiuc.ncsa.security.core.configuration.ConfigTest) Test(org.junit.Test)

Aggregations

OA4MPIdentifierProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider)8 Test (org.junit.Test)6 OA2ClientProvider (edu.uiuc.ncsa.security.oauth_2_0.OA2ClientProvider)5 JSONObject (net.sf.json.JSONObject)5 OA2ClientConverter (edu.uiuc.ncsa.security.oauth_2_0.OA2ClientConverter)4 Client (edu.uiuc.ncsa.security.delegation.storage.Client)3 OA2ClientMemoryStore (edu.uiuc.ncsa.myproxy.oa4mp.oauth2.storage.OA2ClientMemoryStore)2 ClientProvider (edu.uiuc.ncsa.security.delegation.storage.ClientProvider)2 ClientConverter (edu.uiuc.ncsa.security.delegation.storage.impl.ClientConverter)2 OA2Client (edu.uiuc.ncsa.security.oauth_2_0.OA2Client)2 OA2ServiceTransaction (edu.uiuc.ncsa.myproxy.oa4mp.oauth2.OA2ServiceTransaction)1 MultiDSClientStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientStoreProvider)1 DSFSClientStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider)1 DSClientSQLStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.sql.provider.DSClientSQLStoreProvider)1 IdentifiableProvider (edu.uiuc.ncsa.security.core.IdentifiableProvider)1 ConfigTest (edu.uiuc.ncsa.security.core.configuration.ConfigTest)1 MyLoggingFacade (edu.uiuc.ncsa.security.core.util.MyLoggingFacade)1 ClientStore (edu.uiuc.ncsa.security.delegation.server.storage.ClientStore)1 ClientMemoryStore (edu.uiuc.ncsa.security.delegation.server.storage.impl.ClientMemoryStore)1 BaseClientConverter (edu.uiuc.ncsa.security.delegation.storage.impl.BaseClientConverter)1