how to custom service registry

199 views
Skip to first unread message

Night King

unread,
Nov 18, 2023, 12:06:57 PM11/18/23
to CAS Community
i‘m trying to add custom service registry

package org.apereo.cas.support; 
  @AutoConfiguration 
@EnableConfigurationProperties(CasConfigurationProperties.class) 
public class MyConfiguration implements ServiceRegistryExecutionPlanConfigurer { 
  @Bean 
  @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT) 
  public ServiceRegistryDao serviceRegistry() { 
  } 
  @Override 
  public void configureServiceRegistry(final ServiceRegistryExecutionPlan plan) {                    plan.registerServiceRegistry(serviceRegistry()); 
  } }

this is not working, ServiceRegistryDao is not found.

Ray Bon

unread,
Nov 20, 2023, 1:14:12 PM11/20/23
to cas-...@apereo.org
Night,

This might be the replacement, JpaServiceRegistry
It looks like the docs have not changed the name since the class no longer exists.

Ray

On Sat, 2023-11-18 at 06:30 -0800, Night King wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.

Miguel Martínez De Espronceda Cámara

unread,
Nov 21, 2023, 3:48:07 AM11/21/23
to cas-...@apereo.org
Hi Night,
Are you storing your services in RDBMS or are you just using it as an in-memory store? 

In that last case you could use InMemoryServiceRegistry:

        ServiceRegistry registry = new InMemoryServiceRegistry(applicationContext);

It is implemented in cas-server-core-services-registry

Best regards,
Miguel

PD: In our case, we use it to load services statically at startup from application.{properties,yml} definitions like this:

# Organization standard services
# Assumed SAML2, standard attributes, response signed and encrypted, persistent NameID
services.webmail.entityID=mail.example.com
services.webmail.name=Mail
# Rare integrations
services.gitlab.entityID=git.example.com
services.gitlab.name=GitLab
services.gitlab.access.allowedGroups=example.gitlab.user
services.gitlab.mappedAttributes=eduPersonAffiliation, eduPersonPrincipalName, mail, cn, givenName, sn




--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/54ca388c426e26a61fdf5d2f2280a5e2c87c0647.camel%40uvic.ca.


--
Universidad de NavarraMiguel Martínez de Espronceda Cámara
Project Manager
Universidad de Navarra
IT Services
Tel: +34 948 425 600 x803156
mmmca...@unav.es


Este mensaje puede contener información confidencial. Si usted no es el destinatario o lo ha recibido por error, por favor, bórrelo de sus sistemas y comuníquelo a la mayor brevedad al remitente. Los datos personales incluidos en los correos electrónicos que intercambie con el personal de la Universidad de Navarra podrán ser almacenados en la libreta de direcciones de su interlocutor y/o en los servidores de la Universidad durante el tiempo fijado en su política interna de conservación de información. La Universidad de Navarra gestiona dichos datos con fines meramente operativos, para permitir el contacto por email entre sus trabajadores/colaboradores y terceros. Puede consultar la Política de Privacidad de la Universidad de Navarra en la dirección: https://www.unav.edu/aviso-legal

 

This email message may contain confidential information. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and then delete this message and any attachments.  The personal information included in email messages exchanged with employees of the University of Navarra may be stored in the database of your interlocutor and/or the servers of the University for the time-period stipulated by its internal information storage policy. The University stores such data for purely administrative purposes, to facilitate e-mail contact between its employees and third parties. The University of Navarra Privacy Policy may be accessed at https://www.unav.edu/aviso-legal      

 

Antes de imprimir este mensaje o sus documentos anexos, asegúrese de que es necesario. Proteger el medio ambiente está en nuestras manos.
Before printing this e-mail or attachments, be sure it is necessary. 
It is in our hands to protect the environment.

Night King

unread,
Nov 21, 2023, 10:42:20 AM11/21/23
to CAS Community, Miguel Martínez De Espronceda Cámara
tks, i've already resolve it

@Bean(name="xbServiceRegistryDao")
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public ServiceRegistry serviceRegistry() {
// XbServiceRegistryDao implements ServiceRegistry
return new XbServiceRegistryDao();
}

@Bean(name="serviceRegistry")
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public ChainingServiceRegistry defaultChainingServiceRegistry(ConfigurableApplicationContext ctx,@Qualifier("xbServiceRegistryDao") ServiceRegistry sg) {
ChainingServiceRegistry csr = new DefaultChainingServiceRegistry(ctx);
csr.addServiceRegistry(sg);
return csr;
}
/// e,this is not working
public void configureServiceRegistry(final ServiceRegistryExecutionPlan plan) {
plan.registerServiceRegistry(serviceRegistry());
}
Reply all
Reply to author
Forward
0 new messages