• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RegisteredService类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jasig.cas.services.RegisteredService的典型用法代码示例。如果您正苦于以下问题:Java RegisteredService类的具体用法?Java RegisteredService怎么用?Java RegisteredService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RegisteredService类属于org.jasig.cas.services包,在下文中一共展示了RegisteredService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: decideAttributeReleaseBasedOnServiceAttributePolicy

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Decide attribute release based on service attribute policy.
 *
 * @param attributes the attributes
 * @param attributeValue the attribute value
 * @param attributeName the attribute name
 * @param service the service
 * @param doesAttributePolicyAllow does attribute policy allow release of this attribute?
 */
protected void decideAttributeReleaseBasedOnServiceAttributePolicy(final Map<String, Object> attributes,
                                                                   final String attributeValue,
                                                                   final String attributeName,
                                                                   final RegisteredService service,
                                                                   final boolean doesAttributePolicyAllow) {
    if (StringUtils.isNotBlank(attributeValue)) {
        logger.debug("Obtained [{}] as an authentication attribute", attributeName);

        if (doesAttributePolicyAllow) {
            logger.debug("Obtained [{}] is passed to the CAS validation payload", attributeName);
            attributes.put(attributeName, Collections.singleton(attributeValue));
        } else {
            logger.debug("Attribute release policy for [{}] does not authorize the release of [{}]",
                    service.getServiceId(), attributeName);
            attributes.remove(attributeName);
        }
    } else {
        logger.trace("[{}] is not available and will not be released to the validation response.", attributeName);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:30,代码来源:AbstractCasView.java


示例2: checkSaveMethod

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Test
public void checkSaveMethod() {
    final OAuthRegisteredService r = new OAuthRegisteredService();
    r.setName("checkSaveMethod");
    r.setServiceId("testId");
    r.setTheme("theme");
    r.setDescription("description");
    r.setClientId("clientid");
    r.setServiceId("secret");
    r.setBypassApprovalPrompt(true);
    final RegisteredService r2 = this.dao.save(r);
    assertTrue(r2 instanceof OAuthRegisteredService);
    this.dao.load();
    final RegisteredService r3 = this.dao.findServiceById(r2.getId());
    assertTrue(r3 instanceof OAuthRegisteredService);
    assertEquals(r, r2);
    assertEquals(r2, r3);
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:19,代码来源:OAuthRegisteredServiceTests.java


示例3: encodeAttributes

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Override
public final Map<String, Object> encodeAttributes(final Map<String, Object> attributes,
                                                  final Service service) {
    logger.debug("Starting to encode attributes for release to service [{}]", service);
    final Map<String, Object> newEncodedAttributes = new HashMap<>(attributes);
    final Map<String, String> cachedAttributesToEncode = initialize(newEncodedAttributes);

    final RegisteredService registeredService = this.servicesManager.findServiceBy(service);
    if (registeredService != null && registeredService.getAccessStrategy().isServiceAccessAllowed()) {
        encodeAttributesInternal(newEncodedAttributes, cachedAttributesToEncode,
                this.cipherExecutor, registeredService);
        logger.debug("[{}] Encoded attributes are available for release to [{}]",
                newEncodedAttributes.size(), service);
    } else {
        logger.debug("Service [{}] is not found and/or enabled in the service registry. "
                + "No encoding has taken place.", service);
    }

    return newEncodedAttributes;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:21,代码来源:AbstractCasAttributeEncoder.java


示例4: encryptAndEncodeAndPutIntoAttributesMap

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Encrypt, encode and put the attribute into attributes map.
 *
 * @param attributes the attributes
 * @param cachedAttributesToEncode the cached attributes to encode
 * @param cachedAttributeName the cached attribute name
 * @param cipher the cipher
 * @param registeredService the registered service
 */
protected final void encryptAndEncodeAndPutIntoAttributesMap(final Map<String, Object> attributes,
                                                       final Map<String, String> cachedAttributesToEncode,
                                                       final String cachedAttributeName,
                                                       final RegisteredServiceCipherExecutor cipher,
                                                       final RegisteredService registeredService) {
    final String cachedAttribute = cachedAttributesToEncode.remove(cachedAttributeName);
    if (StringUtils.isNotBlank(cachedAttribute)) {
        logger.debug("Retrieved [{}] as a cached model attribute...", cachedAttributeName);
        final String encodedValue = cipher.encode(cachedAttribute, registeredService);
        if (StringUtils.isNotBlank(encodedValue)) {
            attributes.put(cachedAttributeName, encodedValue);
            logger.debug("Encrypted and encoded [{}] as an attribute to [{}].",
                    cachedAttributeName, encodedValue);
        }
    } else {
        logger.debug("[{}] is not available as a cached model attribute to encrypt...", cachedAttributeName);
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:28,代码来源:DefaultCasAttributeEncoder.java


示例5: setUpMocks

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Before
public void setUpMocks() {
    final RegisteredServiceImpl authorizedRegisteredService = new RegisteredServiceImpl();
    final RegisteredServiceImpl unauthorizedRegisteredService = new RegisteredServiceImpl();
    unauthorizedRegisteredService.setAccessStrategy(
            new DefaultRegisteredServiceAccessStrategy(false, false));

    final List<RegisteredService> list = new ArrayList<>();
    list.add(authorizedRegisteredService);
    list.add(unauthorizedRegisteredService);
    
    when(this.servicesManager.findServiceBy(this.authorizedService)).thenReturn(authorizedRegisteredService);
    when(this.servicesManager.findServiceBy(this.unauthorizedService)).thenReturn(unauthorizedRegisteredService);
    when(this.servicesManager.findServiceBy(this.undefinedService)).thenReturn(null);
    
    when(this.servicesManager.getAllServices()).thenReturn(list);
    
    this.serviceAuthorizationCheck = new ServiceAuthorizationCheck(this.servicesManager);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:20,代码来源:ServiceAuthorizationCheckTests.java


示例6: isAuthenticationRenewed

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Tries to determine if authentication was created as part of a "renew" event.
 * Renewed authentications can occur if the service is not allowed to participate
 * in SSO or if a "renew" request parameter is specified.
 *
 * @param ctx the request context
 * @return true if renewed
 */
private boolean isAuthenticationRenewed(final RequestContext ctx) {
    if (ctx.getRequestParameters().contains(CasProtocolConstants.PARAMETER_RENEW)) {
        LOGGER.debug("[{}] is specified for the request. The authentication session will be considered renewed.",
                CasProtocolConstants.PARAMETER_RENEW);
        return true;
    }

    final Service service = WebUtils.getService(ctx);
    if (service != null) {
        final RegisteredService registeredService = this.servicesManager.findServiceBy(service);
        if (registeredService != null) {
            final boolean isAllowedForSso = registeredService.getAccessStrategy().isServiceAccessAllowedForSso();
            LOGGER.debug("Located [{}] in registry. Service access to participate in SSO is set to [{}]",
                    registeredService.getServiceId(), isAllowedForSso);
            return !isAllowedForSso;
        }
    }

    return false;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:29,代码来源:SendTicketGrantingTicketAction.java


示例7: setUpMocks

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Before
public void setUpMocks() {
    RegisteredServiceImpl authorizedRegisteredService = new RegisteredServiceImpl();
    RegisteredServiceImpl unauthorizedRegisteredService = new RegisteredServiceImpl();
    unauthorizedRegisteredService.setEnabled(false);

    List<RegisteredService> list = new ArrayList<RegisteredService>();
    list.add(authorizedRegisteredService);
    list.add(unauthorizedRegisteredService);
    
    when(this.servicesManager.findServiceBy(this.authorizedService)).thenReturn(authorizedRegisteredService);
    when(this.servicesManager.findServiceBy(this.unauthorizedService)).thenReturn(unauthorizedRegisteredService);
    when(this.servicesManager.findServiceBy(this.undefinedService)).thenReturn(null);
    
    when(this.servicesManager.getAllServices()).thenReturn(list);
    
    this.serviceAuthorizationCheck = new ServiceAuthorizationCheck(this.servicesManager);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:19,代码来源:ServiceAuthorizationCheckTests.java


示例8: verifyAddMockRegisteredService

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Test
public void verifyAddMockRegisteredService() throws Exception {
    registeredServiceFactory.setRegisteredServiceMapper(new MockRegisteredServiceMapper());

    final MockRegisteredService svc = new MockRegisteredService();
    svc.setDescription("description");
    svc.setServiceId("^serviceId");
    svc.setName("name");
    svc.setId(1000);
    svc.setEvaluationOrder(1000);

    final RegisteredServiceEditBean.ServiceData data = registeredServiceFactory.createServiceData(svc);
    this.controller.saveService(new MockHttpServletRequest(),
            new MockHttpServletResponse(),
            data, mock(BindingResult.class));

    final Collection<RegisteredService> services = this.manager.getAllServices();
    assertEquals(1, services.size());
    for (final  RegisteredService rs : this.manager.getAllServices()) {
        assertTrue(rs instanceof MockRegisteredService);
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:23,代码来源:RegisteredServiceSimpleFormControllerTests.java


示例9: save

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Override
public RegisteredService save(final RegisteredService rs) {
    if (this.ldapServiceMapper != null) {
        if (rs.getId() != RegisteredService.INITIAL_IDENTIFIER_VALUE) {
            return update(rs);
        }

        try {
            final LdapEntry entry = this.ldapServiceMapper.mapFromRegisteredService(this.baseDn, rs);
            LdapUtils.executeAddOperation(this.connectionFactory, entry);
        } catch (final LdapException e) {
            logger.error(e.getMessage(), e);
        }
        return rs;
    }
    return null;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:18,代码来源:LdapServiceRegistryDao.java


示例10: verifyLogoutUrlForServiceIsUsed

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Test
public void verifyLogoutUrlForServiceIsUsed() throws Exception {
    final RegisteredService svc = getRegisteredService();
    when(this.servicesManager.findServiceBy(any(SingleLogoutService.class))).thenReturn(svc);

    final SingleLogoutService service = mock(SingleLogoutService.class);
    when(service.getId()).thenReturn(svc.getServiceId());
    when(service.getOriginalUrl()).thenReturn(svc.getServiceId());

    final MockTicketGrantingTicket tgt = new MockTicketGrantingTicket("test");
    tgt.getServices().put("service", service);
    final Event event = getLogoutEvent(this.logoutManager.performLogout(tgt));
    assertEquals(FrontChannelLogoutAction.REDIRECT_APP_EVENT, event.getId());
    final List<LogoutRequest> list = WebUtils.getLogoutRequests(this.requestContext);
    assertEquals(1, list.size());
    final String url = (String) event.getAttributes().get(FrontChannelLogoutAction.DEFAULT_FLOW_ATTRIBUTE_LOGOUT_URL);
    assertTrue(url.startsWith(svc.getLogoutUrl().toExternalForm()));

}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:20,代码来源:FrontChannelLogoutActionTests.java


示例11: initializeCipherBasedOnServicePublicKey

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Initialize cipher based on service public key.
 *
 * @param publicKey the public key
 * @param registeredService the registered service
 * @return the false if no public key is found
 * or if cipher cannot be initialized, etc.
 */
private Cipher initializeCipherBasedOnServicePublicKey(final PublicKey publicKey,
                                                       final RegisteredService registeredService) {
    try {
        logger.debug("Using public key [{}] to initialize the cipher",
                registeredService.getPublicKey());

        final Cipher cipher = Cipher.getInstance(publicKey.getAlgorithm());
        cipher.init(Cipher.ENCRYPT_MODE, publicKey);
        logger.debug("Initialized cipher in encrypt-mode via the public key algorithm [{}]",
                publicKey.getAlgorithm());
        return cipher;
    } catch (final Exception e) {
        logger.warn("Cipher could not be initialized for service [{}]. Error [{}]",
                registeredService, e.getMessage());
    }
    return null;
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:26,代码来源:DefaultRegisteredServiceCipherExecutor.java


示例12: updateRegisteredServiceEvaluationOrder

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Updates the {@link RegisteredService#getEvaluationOrder()}.
 *
 * @param response the response
 * @param id the service ids, whose order also determines the service evaluation order
 */
@RequestMapping(value="updateRegisteredServiceEvaluationOrder.html", method={RequestMethod.POST})
public void updateRegisteredServiceEvaluationOrder(final HttpServletResponse response,
                                                   @RequestParam("id") final long... id) {
    if (id == null || id.length == 0) {
        throw new IllegalArgumentException("No service id was received. Re-examine the request");
    }
    for (int i = 0; i < id.length; i++) {
        final long svcId = id[i];
        final RegisteredService svc = this.servicesManager.findServiceBy(svcId);
        if (svc == null) {
            throw new IllegalArgumentException("Service id " + svcId + " cannot be found.");
        }
        svc.setEvaluationOrder(i);
        this.servicesManager.save(svc);
    }
    final Map<String, Object> model = new HashMap<>();
    model.put("status", HttpServletResponse.SC_OK);
    JsonViewUtils.render(model, response);
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:26,代码来源:ManageRegisteredServicesMultiActionController.java


示例13: getRegexRegisteredService

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
private static RegisteredService getRegexRegisteredService() {
    final AbstractRegisteredService rs  = new RegexRegisteredService();
    rs.setName("Service Name Regex");
    rs.setProxyPolicy(new RefuseRegisteredServiceProxyPolicy());
    rs.setUsernameAttributeProvider(new AnonymousRegisteredServiceUsernameAttributeProvider(
            new ShibbolethCompatiblePersistentIdGenerator("hello")
    ));
    rs.setDescription("Service description");
    rs.setServiceId("^http?://.+");
    rs.setTheme("the theme name");
    rs.setEvaluationOrder(123);
    rs.setDescription("Here is another description");
    rs.setRequiredHandlers(new HashSet<>(Arrays.asList("handler1", "handler2")));

    final Map<String, RegisteredServiceProperty> propertyMap = new HashMap();
    final DefaultRegisteredServiceProperty property = new DefaultRegisteredServiceProperty();

    final Set<String> values = new HashSet<>();
    values.add("value1");
    values.add("value2");
    property.setValues(values);
    propertyMap.put("field1", property);
    rs.setProperties(propertyMap);

    return rs;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:27,代码来源:LdapServiceRegistryDaoTests.java


示例14: getServiceById

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Gets service by id.
 *
 * @param id       the id
 * @param request  the request
 * @param response the response
 */
@RequestMapping(method = RequestMethod.GET, value = {"getService.html"})
public void getServiceById(@RequestParam(value = "id", required = false) final Long id,
                           final HttpServletRequest request, final HttpServletResponse response) {

    try {
        final RegisteredServiceEditBean bean = new RegisteredServiceEditBean();
        if (id == -1) {
            bean.setServiceData(null);
        } else {
            final RegisteredService service = this.servicesManager.findServiceBy(id);

            if (service == null) {
                logger.warn("Invalid service id specified [{}]. Cannot find service in the registry", id);
                throw new IllegalArgumentException("Service id " + id + " cannot be found");
            }
            bean.setServiceData(registeredServiceFactory.createServiceData(service));
        }
        bean.setFormData(registeredServiceFactory.createFormData());

        bean.setStatus(HttpServletResponse.SC_OK);
        JsonViewUtils.render(bean, response);
    } catch (final Exception e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:33,代码来源:RegisteredServiceSimpleFormController.java


示例15: determineLogoutUrl

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Determine logout url.
 *
 * @param registeredService the registered service
 * @param singleLogoutService the single logout service
 * @return the uRL
 */
private URL determineLogoutUrl(final RegisteredService registeredService, final SingleLogoutService singleLogoutService) {
    try {
        URL logoutUrl = new URL(singleLogoutService.getOriginalUrl());
        final URL serviceLogoutUrl = registeredService.getLogoutUrl();

        if (serviceLogoutUrl != null) {
            LOGGER.debug("Logout request will be sent to [{}] for service [{}]",
                    serviceLogoutUrl, singleLogoutService);
            logoutUrl = serviceLogoutUrl;
        }
        return logoutUrl;
    } catch (final Exception e) {
        throw new IllegalArgumentException(e);
    }
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:23,代码来源:LogoutManagerImpl.java


示例16: prepareSamlAttributes

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
/**
 * Prepare saml attributes. Combines both principal and authentication
 * attributes. If the authentication is to be remembered, uses {@link #setRememberMeAttributeName(String)}
 * for the remember-me attribute name.
 *
 * @param model the model
 * @return the final map
 * @since 4.1.0
 */
private Map<String, Object> prepareSamlAttributes(final Map<String, Object> model, final Service service) {
    final Map<String, Object> authnAttributes = new HashMap<>(getAuthenticationAttributesAsMultiValuedAttributes(model));
    if (isRememberMeAuthentication(model)) {
        authnAttributes.remove(RememberMeCredential.AUTHENTICATION_ATTRIBUTE_REMEMBER_ME);
        authnAttributes.put(this.rememberMeAttributeName, Boolean.TRUE.toString());
    }
    final RegisteredService registeredService = this.servicesManager.findServiceBy(service);
    final Map<String, Object> attributesToReturn = new HashMap<>();
    attributesToReturn.putAll(getPrincipalAttributesAsMultiValuedAttributes(model));
    attributesToReturn.putAll(authnAttributes);

    decideIfCredentialPasswordShouldBeReleasedAsAttribute(attributesToReturn, model, registeredService);
    decideIfProxyGrantingTicketShouldBeReleasedAsAttribute(attributesToReturn, model, registeredService);

    final Map<String, Object> finalAttributes = this.casAttributeEncoder.encodeAttributes(attributesToReturn, service);
    return finalAttributes;
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:27,代码来源:Saml10SuccessResponseView.java


示例17: testExpiredServiceTicket

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Test
public void testExpiredServiceTicket() throws Exception {
    final MockHttpServletRequest mockRequest = new MockHttpServletRequest("GET", CONTEXT
            + OAuthConstants.ACCESS_TOKEN_URL);
    mockRequest.setParameter(OAuthConstants.CLIENT_ID, CLIENT_ID);
    mockRequest.setParameter(OAuthConstants.REDIRECT_URI, REDIRECT_URI);
    mockRequest.setParameter(OAuthConstants.CLIENT_SECRET, CLIENT_SECRET);
    mockRequest.setParameter(OAuthConstants.CODE, CODE);
    final MockHttpServletResponse mockResponse = new MockHttpServletResponse();
    final ServicesManager servicesManager = mock(ServicesManager.class);
    final List<RegisteredService> services = new ArrayList<RegisteredService>();
    services.add(getRegisteredService(REDIRECT_URI, CLIENT_SECRET));
    when(servicesManager.getAllServices()).thenReturn(services);
    final TicketRegistry ticketRegistry = mock(TicketRegistry.class);
    final ServiceTicket serviceTicket = mock(ServiceTicket.class);
    when(serviceTicket.isExpired()).thenReturn(true);
    when(ticketRegistry.getTicket(CODE)).thenReturn(serviceTicket);
    final OAuth20WrapperController oauth20WrapperController = new OAuth20WrapperController();
    oauth20WrapperController.setServicesManager(servicesManager);
    oauth20WrapperController.setTicketRegistry(ticketRegistry);
    oauth20WrapperController.afterPropertiesSet();
    oauth20WrapperController.handleRequest(mockRequest, mockResponse);
    assertEquals(400, mockResponse.getStatus());
    assertEquals("error=" + OAuthConstants.INVALID_GRANT, mockResponse.getContentAsString());
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:26,代码来源:OAuth20AccessTokenControllerTests.java


示例18: getGoogleAccountsService

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
public GoogleAccountsService getGoogleAccountsService() throws Exception {
    final MockHttpServletRequest request = new MockHttpServletRequest();

    final String samlRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
          + "<samlp:AuthnRequest xmlns:samlp=\"urn:oasis:names:tc:SAML:2.0:protocol\" "
          + "ID=\"5545454455\" Version=\"2.0\" IssueInstant=\"Value\" "
          + "ProtocolBinding=\"urn:oasis:names.tc:SAML:2.0:bindings:HTTP-Redirect\" "
          + "ProviderName=\"https://localhost:8443/myRutgers\" AssertionConsumerServiceURL=\"https://localhost:8443/myRutgers\"/>";
    request.setParameter(SamlProtocolConstants.PARAMETER_SAML_REQUEST, encodeMessage(samlRequest));
    request.setParameter(SamlProtocolConstants.PARAMETER_SAML_RELAY_STATE, "RelayStateAddedHere");

    final RegisteredService regSvc = mock(RegisteredService.class);
    when(regSvc.getUsernameAttributeProvider()).thenReturn(new DefaultRegisteredServiceUsernameProvider());
    
    final ServicesManager servicesManager = mock(ServicesManager.class);
    when(servicesManager.findServiceBy(any(Service.class))).thenReturn(regSvc);
    
    return factory.createService(request);
}
 
开发者ID:yuweijun,项目名称:cas-server-4.2.1,代码行数:20,代码来源:GoogleAccountsServiceTests.java


示例19: filter

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Override
public Map<String, Object> filter(final String principalId, final Map<String, Object> givenAttributes,
        final RegisteredService registeredService) {
    final Map<String, Object> attributes = new HashMap<String, Object>();

    if (registeredService.isIgnoreAttributes()) {
        logger.debug("Service [{}] is set to ignore attribute release policy. Releasing all attributes.",
                registeredService.getName());
        attributes.putAll(givenAttributes);
    } else {
        for (final String attribute : registeredService.getAllowedAttributes()) {
            final Object value = givenAttributes.get(attribute);

            if (value != null) {
                logger.debug("Found attribute [{}] in the list of allowed attributes for service [{}]", attribute,
                        registeredService.getName());
                attributes.put(attribute, value);
            }
        }
    }
    return Collections.unmodifiableMap(attributes);
}
 
开发者ID:luotuo,项目名称:cas4.0.x-server-wechat,代码行数:23,代码来源:RegisteredServiceDefaultAttributeFilter.java


示例20: read

import org.jasig.cas.services.RegisteredService; //导入依赖的package包/类
@Override
public RegisteredService read(final Kryo kryo, final Input input, final Class<RegisteredService> type) {
    final AbstractRegisteredService svc = new RegexRegisteredService();
    svc.setServiceId(kryo.readObject(input, String.class));
    svc.setName(kryo.readObject(input, String.class));
    svc.setDescription(kryo.readObject(input, String.class));
    svc.setId(kryo.readObject(input, Long.class));
    svc.setEvaluationOrder(kryo.readObject(input, Integer.class));
    svc.setLogo(kryo.readObject(input, URL.class));
    svc.setLogoutType(kryo.readObject(input, LogoutType.class));
    svc.setLogoutUrl(kryo.readObject(input, URL.class));
    svc.setRequiredHandlers(kryo.readObject(input, ImmutableSet.class));
    svc.setTheme(kryo.readObject(input, String.class));

    svc.setPublicKey(readObjectByReflection(kryo, input, RegisteredServicePublicKey.class));
    svc.setProxyPolicy(readObjectByReflection(kryo, input, RegisteredServiceProxyPolicy.class));
    svc.setAttributeReleasePolicy(readObjectByReflection(kryo, input, RegisteredServiceAttributeReleasePolicy.class));
    svc.setUsernameAttributeProvider(readObjectByReflection(kryo, input, RegisteredServiceUsernameAttributeProvider.class));
    svc.setAccessStrategy(readObjectByReflection(kryo, input, RegisteredServiceAccessStrategy.class));

    return svc;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:23,代码来源:RegisteredServiceSerializer.java



注:本文中的org.jasig.cas.services.RegisteredService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Quad类代码示例发布时间:2022-05-21
下一篇:
Java EngineOptions类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap