use of edu.uiuc.ncsa.security.oauth_2_0.server.config.LDAPConfiguration in project OA4MP by ncsa.
the class DDServerTests method getOa2Client.
protected OA2Client getOa2Client(ClientStore store) {
OA2Client c = (OA2Client) store.create();
String random = getRandom(8);
c.setSecret(getRandom(64));
c.setProxyLimited(true);
c.setHomeUri("https://baz.foo.edu/" + random + "/home");
c.setErrorUri("https://baz.foo.edu/home/" + random + "/error");
c.setProxyLimited(false);
c.setEmail("bob@" + random + ".foo.bar");
c.setName("Test client " + random);
c.setRtLifetime(456767875477L);
LinkedList<String> callbacks = new LinkedList<>();
callbacks.add("https:/baz.foo.edu/client2/" + random + "/ready1");
callbacks.add("https:/baz.foo.edu/client2/" + random + "/ready2");
c.setCallbackURIs(callbacks);
LDAPConfiguration ldapConfiguration = new LDAPConfiguration();
ldapConfiguration.setServer("foo.bar.edu");
LinkedList<LDAPConfiguration> ldaps = new LinkedList<>();
ldaps.add(ldapConfiguration);
c.setLdaps(ldaps);
LinkedList<String> scopes = new LinkedList<>();
scopes.add(OA2Scopes.SCOPE_OPENID);
scopes.add(OA2Scopes.SCOPE_EMAIL);
scopes.add(OA2Scopes.SCOPE_PROFILE);
scopes.add(OA2Scopes.SCOPE_CILOGON_INFO);
c.setScopes(scopes);
store.save(c);
return c;
}
Aggregations