Search in sources :

Example 1 with OA2ClientMemoryStore

use of edu.uiuc.ncsa.myproxy.oa4mp.oauth2.storage.OA2ClientMemoryStore in project OA4MP by ncsa.

the class ClientManagerTest method testOA2Client.

@Test
public void testOA2Client() throws Exception {
    OA2ClientProvider clientProvider = new OA2ClientProvider(new OA4MPIdentifierProvider(OA4MPIdentifierProvider.CLIENT_ID));
    OA2ClientMemoryStore store = new OA2ClientMemoryStore(clientProvider);
    OA2ClientConverter converter = new OA2ClientConverter(clientProvider);
    OA2Client c = getOa2Client(store);
    JSONObject j = new JSONObject();
    converter.toJSON(c, j);
    System.out.println(j);
    Client c2 = converter.fromJSON(j);
    assert c2.equals(c);
}
Also used : OA2Client(edu.uiuc.ncsa.security.oauth_2_0.OA2Client) OA4MPIdentifierProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider) OA2ClientProvider(edu.uiuc.ncsa.security.oauth_2_0.OA2ClientProvider) JSONObject(net.sf.json.JSONObject) OA2ClientMemoryStore(edu.uiuc.ncsa.myproxy.oa4mp.oauth2.storage.OA2ClientMemoryStore) Client(edu.uiuc.ncsa.security.delegation.storage.Client) OA2Client(edu.uiuc.ncsa.security.oauth_2_0.OA2Client) OA2ClientConverter(edu.uiuc.ncsa.security.oauth_2_0.OA2ClientConverter) Test(org.junit.Test)

Aggregations

OA2ClientMemoryStore (edu.uiuc.ncsa.myproxy.oa4mp.oauth2.storage.OA2ClientMemoryStore)1 OA4MPIdentifierProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider)1 Client (edu.uiuc.ncsa.security.delegation.storage.Client)1 OA2Client (edu.uiuc.ncsa.security.oauth_2_0.OA2Client)1 OA2ClientConverter (edu.uiuc.ncsa.security.oauth_2_0.OA2ClientConverter)1 OA2ClientProvider (edu.uiuc.ncsa.security.oauth_2_0.OA2ClientProvider)1 JSONObject (net.sf.json.JSONObject)1 Test (org.junit.Test)1