0

Please help in this regard, I have been struggling for more than a week now to solve this one, however, no success. I have tried all possible changes from my side.

Logs which I get in catalina.out:

2017-09-19 09:45:20,094 WARN [org.jasig.cas.CentralAuthenticationServiceImpl] - <ServiceManagement: Unauthorized Service Access. Service [http://hidden1:9001/ssomanager/c/SSB] not found in Service Registry.>
2017-09-19 09:45:20,094 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: CASAdmin
WHAT: http://hidden:9001/ssomanager/c/SSB
ACTION: SERVICE_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Tue Sep 19 09:45:20 AST 2017
CLIENT IP ADDRESS: <abc>
SERVER IP ADDRESS: <pqr>
=============================================================

On the front end I get the below error:

Application Not Authorized to Use CAS
The application you attempted to authenticate to is not authorized to use CAS.

cas.properties file:

server.prefix=https://hidden1:8443/cas

cas.securityContext.serviceProperties.service=${server.prefix}/services/j_acegi_cas_security_check
# Names of roles allowed to access the CAS service manager
cas.securityContext.serviceProperties.adminRoles=ROLE_ADMIN
cas.securityContext.casProcessingFilterEntryPoint.loginUrl=${server.prefix}/login
cas.securityContext.ticketValidator.casServerUrlPrefix=${server.prefix}


cas.themeResolver.defaultThemeName=cas-theme-default
cas.viewResolver.basename=default_views

host.name=hidden1

#database.hibernate.dialect=org.hibernate.dialect.OracleDialect
#database.hibernate.dialect=org.hibernate.dialect.MySQLDialect
database.hibernate.dialect=org.hibernate.dialect.HSQLDialect

deployerConfigContext.xml has these entries to open the application, still, it's not going through:

<bean class="org.jasig.cas.services.RegisteredServiceImpl">
               <property name="id" value="2" />
               <property name="name" value="SSO Manager" />
               <property name="description" value="CAS Client for SSB/INB" />
               <property name="serviceId" value="http://hidden:9001/ssomanager/c/**" />
               <property name="allowedAttributes">
               <list>
               <value>uid</value>
               <value>UDC_IDENTIFIER</value>
               </list>
               </property>
               <property name="evaluationOrder" value="10000002" />
</bean>

    <bean class="org.jasig.cas.services.RegisteredServiceImpl">
                    <property name="id" value="1" />
                    <property name="name" value="CAS Managed Services" />
                    <property name="description" value="CAS Managed Services Endpoint" />
                    <property name="serviceId" value="https://hidden1:8443/cas/services/**" />
                    <property name="allowedAttributes">
                    <list>
                    <value>uid</value>
                    <value>UDC_IDENTIFIER</value>
                    </list>
                    </property>
                    <property name="evaluationOrder" value="10000001" />
            </bean>

Folder Structure:

[tomcat@bancas cas-server-3.4.12.1]$ ls
assembly.xml                       cas-server-integration-memcached  cas-server-support-legacy   cas-server-support-x509  modules
cas-server-core                    cas-server-integration-restlet    cas-server-support-openid   cas-server-uber-webapp   notice.txt
cas-server-documentation           cas-server-support-generic        cas-server-support-radius   cas-server-webapp        pom.xml
cas-server-integration-berkeleydb  cas-server-support-jdbc           cas-server-support-spnego   INSTALL.txt              tasks.xml
cas-server-integration-jboss       cas-server-support-ldap           cas-server-support-trusted  license.txt
[tomcat@bancas cas-server-3.4.12.1]$
[tomcat@bancas cas-server-3.4.12.1]$ cd cas-server-webapp/
[tomcat@bancas cas-server-webapp]$

[tomcat@bancas cas-server-webapp]$ ls
old_targets  pom.xml  pom.xml_orig  src  target
[tomcat@bancas cas-server-webapp]$

Not able to figure out where is the problem or If I need to provide more information please do let me know.

Tried with cas 4.2.0 version and facing error while generating war file:

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[3,46] package org.jasig.cas.authentication.principal does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[9,36] package org.springframework.mock.web does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[26,27] method setConfigLocations in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext cannot be applied to given types;
  required: java.lang.String[]
  found: java.lang.String,java.lang.String,java.lang.String,java.lang.String
  reason: actual and formal argument lists differ in length
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[31,50] cannot find symbol
  symbol:   class MockServletContext
  location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[52,15] cannot find symbol
  symbol:   class PrincipalFactory
  location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[53,64] cannot find symbol
  symbol:   class PrincipalFactory
  location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[54,15] cannot find symbol
  symbol:   class PrincipalFactory
  location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[55,64] cannot find symbol
  symbol:   class PrincipalFactory
  location: class org.jasig.cas.WiringTests
[INFO] 8 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.593 s
[INFO] Finished at: 2017-09-24T15:06:20+03:00
[INFO] Final Memory: 13M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project local-cas: Compilation failure: Compilation failure:
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[3,46] package org.jasig.cas.authentication.principal does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[9,36] package org.springframework.mock.web does not exist
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[26,27] method setConfigLocations in class org.springframework.context.support.AbstractRefreshableConfigApplicationContext cannot be applied to given types;
[ERROR] required: java.lang.String[]
[ERROR] found: java.lang.String,java.lang.String,java.lang.String,java.lang.String
[ERROR] reason: actual and formal argument lists differ in length
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[31,50] cannot find symbol
[ERROR] symbol:   class MockServletContext
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[52,15] cannot find symbol
[ERROR] symbol:   class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[53,64] cannot find symbol
[ERROR] symbol:   class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[54,15] cannot find symbol
[ERROR] symbol:   class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] /home/tomcat/cas-4.2.0/cas-server-webapp/src/test/java/org/jasig/cas/WiringTests.java:[55,64] cannot find symbol
[ERROR] symbol:   class PrincipalFactory
[ERROR] location: class org.jasig.cas.WiringTests
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Thanks in advance.

Gaurav Bhaskar
  • 195
  • 2
  • 4
  • 18
  • 1
    Please try the following approach in this link, https://stackoverflow.com/questions/46007683/how-can-i-register-my-webapp-in-cas-services-management/46014743#46014743 – SaAn Sep 19 '17 at 12:24
  • Hello Saan - I did not find out /WEB-INF/classes/services directory anywhere in my Cas Configuration. I am using 3.4.12.1 version of Cas.Please suggest what to do next. – Gaurav Bhaskar Sep 20 '17 at 06:22
  • I have worked with cas 4.2.x. Please share your cas folder structure. – SaAn Sep 20 '17 at 11:22
  • Question updated with the folder structure - please help. – Gaurav Bhaskar Sep 20 '17 at 12:15
  • Thank you! I am assuming you deployed the cas application in tomcat. If so, I would think you deployed a cas war in tomcat. In order to generate the war file, I would think you built the cas-server-webapp code and generated the war file. You should be able to find WEB-INF\classes\services in the war file that was geneated out of cas-server-webapp/src code. Let me know if that helps. – SaAn Sep 20 '17 at 13:32
  • Though services folder was not there, I manually created a folder and kept the files as you suggested in the link but no success. What do you think might be the other reason of this? I am really tired of thinking but not getting a clue. – Gaurav Bhaskar Sep 20 '17 at 15:00
  • May be, whatever I am suggesting is specific to 4.2.x and you are running on 3.4.x. Do you have the flexibility of trying out in a different version? I know that the latest cas versions that came out are in 5.x. I am sorry, even I am not getting any more clues. Did you try posting in the cas community google groups? https://groups.google.com/a/apereo.org/forum/#!forum/cas-dev – SaAn Sep 20 '17 at 15:11
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/154919/discussion-between-gunny-kc-and-saan). – Gaurav Bhaskar Sep 20 '17 at 16:05

1 Answers1

0

my case is, I defined the serviceId of cas server in json like "^(http)://192.168.0.14.*", it is ip not localhost.

however, I set the callbackUrl in configuration with localhost:

<bean id="casClient" class="org.pac4j.cas.client.CasClient">
        
        ..
<property name="callbackUrl" value="http://localhost:8080/CDS/callback?client_name=client1"/>
       
</bean>

then this error happened.

set the callbackUrl with ip address solve my problem.

frank
  • 1,169
  • 18
  • 43