Search in sources :

Example 11 with ReturnAllAttributeReleasePolicy

use of org.apereo.cas.services.ReturnAllAttributeReleasePolicy in project cas by apereo.

the class RedisServiceRegistryTests method execSaveMethodWithDefaultUsernameAttribute.

@Test
public void execSaveMethodWithDefaultUsernameAttribute() {
    final RegexRegisteredService r = new RegexRegisteredService();
    r.setName("execSaveMethodWithDefaultUsernameAttribute");
    r.setServiceId("testing");
    r.setDescription("New service");
    r.setUsernameAttributeProvider(new DefaultRegisteredServiceUsernameProvider());
    final ReturnAllAttributeReleasePolicy policy = new ReturnAllAttributeReleasePolicy();
    policy.setConsentPolicy(new DefaultRegisteredServiceConsentPolicy(CollectionUtils.wrapSet("test"), CollectionUtils.wrapSet("test")));
    r.setAttributeReleasePolicy(policy);
    final RegisteredService r2 = this.dao.save(r);
    assertEquals(r2, r);
}
Also used : ReturnAllAttributeReleasePolicy(org.apereo.cas.services.ReturnAllAttributeReleasePolicy) RegexRegisteredService(org.apereo.cas.services.RegexRegisteredService) RegisteredService(org.apereo.cas.services.RegisteredService) DefaultRegisteredServiceConsentPolicy(org.apereo.cas.services.consent.DefaultRegisteredServiceConsentPolicy) DefaultRegisteredServiceUsernameProvider(org.apereo.cas.services.DefaultRegisteredServiceUsernameProvider) RegexRegisteredService(org.apereo.cas.services.RegexRegisteredService) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 12 with ReturnAllAttributeReleasePolicy

use of org.apereo.cas.services.ReturnAllAttributeReleasePolicy in project cas by apereo.

the class AbstractOAuth20Tests method getRegisteredService.

protected static OAuthRegisteredService getRegisteredService(final String serviceId, final String secret) {
    final OAuthRegisteredService registeredServiceImpl = new OAuthRegisteredService();
    registeredServiceImpl.setName("The registered service name");
    registeredServiceImpl.setServiceId(serviceId);
    registeredServiceImpl.setClientId(CLIENT_ID);
    registeredServiceImpl.setClientSecret(secret);
    registeredServiceImpl.setAttributeReleasePolicy(new ReturnAllAttributeReleasePolicy());
    return registeredServiceImpl;
}
Also used : ReturnAllAttributeReleasePolicy(org.apereo.cas.services.ReturnAllAttributeReleasePolicy) OAuthRegisteredService(org.apereo.cas.support.oauth.services.OAuthRegisteredService)

Aggregations

ReturnAllAttributeReleasePolicy (org.apereo.cas.services.ReturnAllAttributeReleasePolicy)12 Test (org.junit.Test)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 RegisteredService (org.apereo.cas.services.RegisteredService)4 ReturnAllowedAttributeReleasePolicy (org.apereo.cas.services.ReturnAllowedAttributeReleasePolicy)4 OAuthRegisteredService (org.apereo.cas.support.oauth.services.OAuthRegisteredService)4 SamlRegisteredService (org.apereo.cas.support.saml.services.SamlRegisteredService)4 HashMap (java.util.HashMap)3 Map (java.util.Map)3 AbstractRegisteredService (org.apereo.cas.services.AbstractRegisteredService)3 AbstractRegisteredServiceAttributeReleasePolicy (org.apereo.cas.services.AbstractRegisteredServiceAttributeReleasePolicy)3 DefaultRegisteredServiceUsernameProvider (org.apereo.cas.services.DefaultRegisteredServiceUsernameProvider)3 DenyAllAttributeReleasePolicy (org.apereo.cas.services.DenyAllAttributeReleasePolicy)3 GroovyScriptAttributeReleasePolicy (org.apereo.cas.services.GroovyScriptAttributeReleasePolicy)3 RegexRegisteredService (org.apereo.cas.services.RegexRegisteredService)3 ReturnMappedAttributeReleasePolicy (org.apereo.cas.services.ReturnMappedAttributeReleasePolicy)3 ScriptedRegisteredServiceAttributeReleasePolicy (org.apereo.cas.services.ScriptedRegisteredServiceAttributeReleasePolicy)3 RegisteredServiceAttributeReleasePolicyEditBean (org.apereo.cas.mgmt.services.web.beans.RegisteredServiceAttributeReleasePolicyEditBean)2 RegisteredServiceAttributeReleasePolicyStrategyEditBean (org.apereo.cas.mgmt.services.web.beans.RegisteredServiceAttributeReleasePolicyStrategyEditBean)2 DefaultRegisteredServiceAccessStrategy (org.apereo.cas.services.DefaultRegisteredServiceAccessStrategy)2