Implementing Services Management Webapp

214 views
Skip to first unread message

carlos maddaleno cuellar

unread,
Jul 21, 2016, 5:48:58 PM7/21/16
to cas-...@apereo.org, jasig-cas-user
im triying to fllow the step on the page of apereo https://apereo.github.io/cas/4.2.x/installation/Installing-ServicesMgmt-Webapp.html#services-management-webapp

but when i run the project it show me the next error:



carlos maddaleno cuellar

unread,
Jul 21, 2016, 5:50:41 PM7/21/16
to jasig-cas-user, cas-...@apereo.org

but when i run the project it show me the next error:

2016-07-21 15:28:11,123 WARN [org.springframework.web.context.support.XmlWebApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'assertionAsReturnValuePrincipalResolver' defined in URL [jar:file:/C:/Projects/cas/cas-services-management-overlay-master/cas-services-management-overlay-master/target/cas-services/WEB-INF/lib/cas-server-core-audit-4.2.3.jar!/org/jasig/cas/audit/spi/AssertionAsReturnValuePrincipalResolver.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver]: : No qualifying bean of type [org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=auditablePrincipalResolver)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=auditablePrincipalResolver)}>
Información:   2016-07-21 15:28:11,152 WARN [org.jasig.cas.services.JsonServiceRegistryConfigWatcher] - <Directory key is no longer valid. Quitting watcher service>
Información:   2016-07-21 15:28:11,157 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'assertionAsReturnValuePrincipalResolver' defined in URL [jar:file:/C:/Projects/cas/cas-services-management-overlay-master/cas-services-management-overlay-master/target/cas-services/WEB-INF/lib/cas-server-core-audit-4.2.3.jar!/org/jasig/cas/audit/spi/AssertionAsReturnValuePrincipalResolver.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver]: : No qualifying bean of type [org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=auditablePrincipalResolver)}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=auditablePrincipalResolver)}


i have configured the next files:

managementConfigContext:

<?xml version="1.0" encoding="UTF-8"?>
<!--
    | managementConfigContext.xml centralizes into one file some of the declarative configuration that
    | all CAS deployers will need to modify for the (services) management webapp.
    |
    | The beans declared in this file are instantiated at context initialization time by the Spring
    | ContextLoaderListener declared in web.xml.  It finds this file because this
    | file is among those declared in the context parameter "contextConfigLocation".
    +-->


    <!--
    This bean defines the security roles for the Services Management application.  Simple deployments can use the in-memory version.
    More robust deployments will want to use another option, such as the Jdbc version.

    The name of this should remain "authorizationGenerator" in order for the pac4j security context to find it.
     -->
    <util:properties id="userProperties" location="${user.details.file.location:classpath:user-details.properties}" />

    <bean id="authorizationGenerator" class="org.pac4j.core.authorization.generator.SpringSecurityPropertiesAuthorizationGenerator">
        <constructor-arg name="properties" ref="userProperties" />
    </bean>

    <!-- 
    Bean that defines the attributes that a service may return.  This example uses the Stub/Mock version.  A real implementation
    may go against a database or LDAP server.  The id should remain "attributeRepository" though.
     -->
    <bean id="attributeRepository"
          class="org.jasig.services.persondir.support.StubPersonAttributeDao" p:backingMap-ref="backingMap">
    </bean>

    <util:map id="backingMap">
        <entry key="uid" value="uid"/>
        <entry key="eduPersonAffiliation" value="eduPersonAffiliation"/>
        <entry key="groupMembership" value="groupMembership"/>
    </util:map>

    <alias name="jsonServiceRegistryDao" alias="serviceRegistryDao" />

    <bean id="auditTrailManager" class="org.jasig.inspektr.audit.support.Slf4jLoggingAuditTrailManager"/>
</beans>

 and the propertiFileConfigurer.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to Jasig under one or more contributor license
    agreements. See the NOTICE file distributed with this work
    for additional information regarding copyright ownership.
    Jasig licenses this file to you under the Apache License,
    Version 2.0 (the "License"); you may not use this file
    except in compliance with the License.  You may obtain a
    copy of the License at the following location:


    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.

-->
    <description>
        This file lets CAS know where you've stored the cas.properties file which details some of the configuration options
        that are specific to your environment.  You can specify the location of the file here.  You may wish to place the file outside
        of the Servlet context if you have options that are specific to a tier (i.e. test vs. production) so that the WAR file
        can be moved between tiers without modification.
    </description>
    <util:properties id="casManagementProperties" location="file:C:/cas/prueba/cas-management.properties" />

    <context:property-placeholder properties-ref="casManagementProperties" />


</beans>


could you help me







Misagh Moayyed

unread,
Jul 22, 2016, 2:17:05 AM7/22/16
to cas-...@apereo.org
Switch to 4.2.4-SNAPSHOT and report back. This is fixed.

-- 
Misagh
--
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 post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CANEG9%2Bcc%3D95BzoKYm4XQzxBeEdEJLwB%3DiACy6191BjNmRfx8ug%40mail.gmail.com.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

carlos maddaleno cuellar

unread,
Jul 25, 2016, 2:08:56 PM7/25/16
to Misagh Moayyed, cas-...@apereo.org, cas...@apereo.org
Hi i could fix the problem on cas-managementeWebappa adding

<bean id="auditablePrincipalResolver" class="org.jasig.cas.audit.spi.TicketOrCredentialPrincipalResolver" />

now its working, what i want to do now is to redirect other application to my cas unis shiro.ini

[main]

#admiRealm.authorizationCachingEnabled = false
cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
securityManager.cacheManager = $cacheManager

casFilter = org.apache.shiro.cas.CasFilter
casFilter.failureUrl = https://localhost:8181/cas/login

#Configuration
conf = gt.gob.mp.siamp.seguridad.wrp.AuthConfiguration
#URL Server CAS
conf.urlCasServer = https://localhost:8181/cas
#URL Client Shiro
#URL Login

casRealm = gt.gob.mp.siamp.seguridad.cliente.ShiroCasRealm
casRealm.defaultRoles = ROLE_USER
casRealm.authConfiguration = $conf

ds = org.apache.shiro.jndi.JndiObjectFactory
ds.resourceName = jdbc/seguridad
ds.resourceRef = true

jdbcRealm = gt.gob.mp.siamp.seguridad.cliente.JdbcRealmSubject
jdbcRealm.permissionsLookupEnabled = true
jdbcRealm.dataSource = $ds

#md5Matcher = org.apache.shiro.authc.credential.Md5CredentialsMatcher
#jdbcRealm.credentialsMatcher = $md5Matcher

hashService = org.apache.shiro.crypto.hash.DefaultHashService
hashService.hashIterations = 512
hashService.hashAlgorithmName = SHA-256
hashService.generatePublicSalt = true

passwordService = org.apache.shiro.authc.credential.DefaultPasswordService
passwordService.hashService = $hashService

passwordMatcher = org.apache.shiro.authc.credential.PasswordMatcher
passwordMatcher.passwordService = $passwordService

casSubjectFactory = org.apache.shiro.cas.CasSubjectFactory
securityManager.subjectFactory = $casSubjectFactory

roles = gt.gob.mp.siamp.seguridad.cliente.ShiroCasFilter
roles.authConfiguration = $conf

[urls]
/rest/1.0/** = anon
# /rest/responsables/** = anon
/shiro-cas = casFilter
/** = roles[ROLE_USER]
/faces/javax.faces.resource/** = anon
/faces/** = roles


i add a service like this

{
  "@class" : "org.jasig.cas.services.RegexRegisteredService",
  "name" : "Correspondencia",
  "id" : 1223363315231709,
  "description" : "Correspondencia",
  "proxyPolicy" : {
    "@class" : "org.jasig.cas.services.RefuseRegisteredServiceProxyPolicy"
  },
  "evaluationOrder" : 2,
  "usernameAttributeProvider" : {
    "@class" : "org.jasig.cas.services.DefaultRegisteredServiceUsernameProvider"
  },
  "logoutType" : "BACK_CHANNEL",
  "attributeReleasePolicy" : {
    "@class" : "org.jasig.cas.services.ReturnAllowedAttributeReleasePolicy",
    "principalAttributesRepository" : {
      "@class" : "org.jasig.cas.authentication.principal.DefaultPrincipalAttributesRepository"
    },
    "authorizedToReleaseCredentialPassword" : false,
    "authorizedToReleaseProxyGrantingTicket" : false
  },
  "accessStrategy" : {
    "@class" : "org.jasig.cas.services.DefaultRegisteredServiceAccessStrategy",
    "enabled" : true,
    "ssoEnabled" : true
  }
}


and on my page appears this

Imágenes integradas 1

can some one help me what can i have to modify to get log on my correspondencia application 

thanks




2016-07-22 8:34 GMT-06:00 carlos maddaleno cuellar <iamcarlos...@gmail.com>:
Hi i try to switch to 4.2.4-SNAPSHOT 

<dependency>
            <groupId>org.jasig.cas</groupId>
            <artifactId>cas-management-webapp</artifactId>
            <version>${cas.version}</version>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>


<cas.version>4.2.4-SNAPSHOT</cas.version>

but when i try to compile  it shows the next error

Failed to execute goal on project cas4-svc-mgmt-overlay: Could not resolve dependencies for project net.unicon:cas4-svc-mgmt-overlay:war:1.0: Could not find artifact org.jasig.cas:cas-management-webapp:war:4.2.4-SNAPSHOT -> [Help 1] what is wrong could you help me


Misagh Moayyed

unread,
Jul 25, 2016, 2:38:29 PM7/25/16
to cas-...@apereo.org
- Post to a single mailing list.
- Switch to 4.2.4-SNAPSHOT, or wait until Friday.
- Your service starts with http. 
ii_156233e16bdfe0bf

carlos maddaleno cuellar

unread,
Jul 25, 2016, 2:56:59 PM7/25/16
to cas-...@apereo.org
I have to change on my service to this:


{
  "@class" : "org.jasig.cas.services.RegexRegisteredService",
ii_156233e16bdfe0bf
Reply all
Reply to author
Forward
0 new messages