Creating custom JDBC authentication handler!

1,953 views
Skip to first unread message

noumann.f

unread,
Dec 6, 2017, 4:18:28 PM12/6/17
to CAS Community
Hi,

I need to create a custom JDBC authentication handler, I'd done this previously with version 4.x but with new version 5.1.x things have changed !!

but I need more details about registering the new handler and how to create special properties for it in the cas.properties and then reach them in the code!

Best regards,

Man H

unread,
Dec 6, 2017, 9:58:19 PM12/6/17
to cas-...@apereo.org
Hi,

I dont have my source at hand at this momemt but it helped  looking into cas src support jdbc. 

Regards
--
- 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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/4b50d3ab-aef7-4424-87a1-b879d10375a7%40apereo.org.

Man H

unread,
Dec 6, 2017, 10:16:36 PM12/6/17
to cas-...@apereo.org
Basically from what i recall,

Get jdbc properties from cas properties and set handler with your required properties, say passwordencoder if applicable, datasource and 2 or three more.


El miércoles, 6 de diciembre de 2017, noumann.f <noum...@gmail.com> escribió:
--

noumann.f

unread,
Dec 7, 2017, 4:43:31 AM12/7/17
to CAS Community
yes, I'm trying to see how things are organized in the cas src support jdbc.

But I'm stuck in how to manage having special JDBC properties related to the customized handler in the cas.properties file, and then what are the related classes to be added and modified according to that?

In my trail I'd created the following hierarchy:
src/
└── main
    ├── java
    │   └── org
    │       └── custom
    │           └── cas
    │              └── adaptors
    │                  └── jdbc
    │                      ├── config
    │                      │   └── CustomAuthenticationEventExecutionPlanConfiguration.java
    │                      └── CustomQueryDatabaseAuthenticationHandler.java
    │               
    └── resources
        └── META-INF
            └── spring.factories

Here is the CustomAuthenticationEventExecutionPlanConfiguration.java class:

package org.custom.cas.adaptors.jdbc.config;
import org.custom.cas.adaptors.jdbc.CustomQueryDatabaseAuthenticationHandler;
.
.
@Configuration("CustomAuthenticationEventExecutionPlanConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class CustomAuthenticationEventExecutionPlanConfiguration
                   
implements AuthenticationEventExecutionPlanConfigurer {

   
private static final Logger LOGGER = LoggerFactory.getLogger(CustomAuthenticationEventExecutionPlanConfiguration.class);

   
@Autowired
   
private CasConfigurationProperties casProperties;

   
@Autowired(required = false)
   
@Qualifier("customQueryPasswordPolicyConfiguration")
   
private PasswordPolicyConfiguration customQueryPasswordPolicyConfiguration;

   
@Autowired
   
@Qualifier("servicesManager")
   
private ServicesManager servicesManager;

   
@Bean
   
public AuthenticationHandler customQueryDatabaseAuthenticationHandler() {

       
final JdbcAuthenticationProperties.Query b;

       
final Map<String, String> attributes = Beans.transformPrincipalAttributesListIntoMap(b.getPrincipalAttributeList());
        LOGGER
.debug("Created and mapped principal attributes [{}] for [{}]...", attributes, b.getUrl());

       
final CustomQueryDatabaseAuthenticationHandler h = new CustomQueryDatabaseAuthenticationHandler(b.getName(), servicesManager,
                jdbcPrincipalFactory
(), b.getOrder(),
               
Beans.newDataSource(b), b.getSql(), b.getFieldPassword(),
                b
.getFieldExpired(), b.getFieldDisabled(), attributes);
...
...
       
return h;
   
}

   
@ConditionalOnMissingBean(name = "jdbcPrincipalFactory")
   
@Bean
   
@RefreshScope
   
public PrincipalFactory jdbcPrincipalFactory() {
       
return new DefaultPrincipalFactory();
   
}

   
@Override
   
public void configureAuthenticationExecutionPlan(final AuthenticationEventExecutionPlan plan) {
        plan
.registerAuthenticationHandler(customQueryDatabaseAuthenticationHandler());
   
}
}

The code above is mostly copied from the org.apereo.cas.adaptors.jdbc.config.CasJdbcAuthenticationConfiguration.java v 5.1.x
BUT again how should I handle the:
final JdbcAuthenticationProperties.Query b
relatively in my case??!!

Regards,


On Thursday, December 7, 2017 at 4:58:19 AM UTC+2, Manfredo Hopp wrote:
Hi,

I dont have my source at hand at this momemt but it helped  looking into cas src support jdbc. 

Regards

El miércoles, 6 de diciembre de 2017, noumann.f <noum...@gmail.com> escribió:
Hi,

I need to create a custom JDBC authentication handler, I'd done this previously with version 4.x but with new version 5.1.x things have changed !!

but I need more details about registering the new handler and how to create special properties for it in the cas.properties and then reach them in the code!

Best regards,

--
- 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.

Man H

unread,
Dec 7, 2017, 12:35:20 PM12/7/17
to cas-...@apereo.org
Ok here you have my configuration.

NOTE however this is for 5.1 version!   Version 5.2 changed sligthly :)

@Configuration("MyAuthenticationEventExecutionPlanConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class MyAuthenticationEventExecutionPlanConfiguration
                    implements AuthenticationEventExecutionPlanConfigurer {

    @Autowired
    @Qualifier("servicesManager")
    private ServicesManager servicesManager;
   
    @Autowired
    @Qualifier("personDirectoryPrincipalResolver")
    private PrincipalResolver personDirectoryPrincipalResolver;
   

    @Autowired
    private CasConfigurationProperties casProperties;
   

    protected PrincipalFactory principalFactory = new DefaultPrincipalFactory();

    @Bean(name = "myUtil")
    public MyUtil myUtil() {
        QueryJdbcAuthenticationProperties query = casProperties.getAuthn().getJdbc().getQuery().get(0);
        return new CConicetUtil(JpaBeans.newDataSource(query));
    }       

           
    @Bean
    public AuthenticationHandler myAuthenticationHandler() {
        /*
            Configure the handler by invoking various setter methods.
            Note that you also have full access to the collection of resolved CAS settings.
            Note that each authentication handler may optionally qualify for an 'order`
            as well as a unique name.
        */
        JdbcAuthenticationProperties.Query query = casProperties.getAuthn().getJdbc().getQuery().get(0);
        return queryDatabaseAuthenticationHandler(query);
    }
   
    private AuthenticationHandler queryDatabaseAuthenticationHandler(final JdbcAuthenticationProperties.Query b) {
        final ConicetAuthenticationHandler handler = new ConicetAuthenticationHandler("MyAuthenticationHandler", servicesManager, principalFactory, 1);
        handler.setDataSource(Beans.newDataSource(b));
        handler.setSql(b.getSql());configured
        handler.setPasswordEncoder(Beans.newPasswordEncoder(b.getPasswordEncoder()));
        handler.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));
        /*
         *
        if (queryPasswordPolicyConfiguration != null) {
            h.setPasswordPolicyConfiguration(queryPasswordPolicyConfiguration);
        }
         */

        handler.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(b.getPrincipalTransformation()));


        if (StringUtils.isNotBlank(b.getCredentialCriteria())) {
            handler.setCredentialSelectionPredicate(credential -> Predicates.containsPattern(b.getCredentialCriteria())
                    .apply(credential.getId()));
        }

        return handler;

    }

    @Override
    public void configureAuthenticationExecutionPlan(final AuthenticationEventExecutionPlan plan) {
            plan.registerAuthenticationHandlerWithPrincipalResolver(conicetAuthenticationHandler(), personDirectoryPrincipalResolver);
    }
}

Notes on the above: this is a veri basic handler, if you woul like to configure webflow for example you could also use this as base.
Here you can also define your own Beans as is the case od MyBean.


Also for AuthenticationHandler I used following class which is usefull because of using some configuration options such as supports(Credential) and also have pre and post processing options. Of course you could choose one that better adjust to your needs

    @NotNull
    private JdbcTemplate jdbcTemplate;

    @NotNull
    private DataSource dataSource

public class MyAuthenticationHandler extends AbstractUsernamePasswordAuthenticationHandler {
    public MyAuthenticationHandler(String name, ServicesManager servicesManager, PrincipalFactory principalFactory,
            Integer order) {
        super(name, servicesManager, principalFactory, order);


Here you put your code in:

    protected final HandlerResult authenticateUsernamePasswordInternal(final UsernamePasswordCredential credential, final String originalPassword)
            throws GeneralSecurityException {

This all is set up throug META-INF spring.factories -> org.springframework.boot.autoconfigure.EnableAutoConfiguration=my.apps.cas.MyAuthenticationEventExecutionPlanConfiguration as stated in docs.

In cas properties you COULD add this:

cas.authn.policy.requiredHandlerAuthenticationPolicyEnabled=true
cas.authn.policy.req.tryAll=false
cas.authn.policy.req.handlerName=MyAuthenticationHandler
cas.authn.policy.req.enabled=true

just to make sure this is the only valid authentication handler.

Also DONT use jdbc support dependency as this is going to use default jdbc AuthenticationHandler as well as yours.


Hope this helps






To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/8a0b7e04-b40f-4508-a5a8-06319bf9d7d6%40apereo.org.

noumann.f

unread,
Dec 11, 2017, 2:45:32 AM12/11/17
to CAS Community
Thanks,
There some points need explanation:
  • return new CConicetUtil(JpaBeans.newDataSource(query));
    • What're the MyUnit, and the CConicetUtil()? whats their purpose?!
  • - JdbcAuthenticationProperties.Query query = casProperties.getAuthn().getJdbc().getQuery().get(0);
    • in here, doesn't this mean that we are still using the Query properties! where I need to use custom properties?
  •  final ConicetAuthenticationHandler handler = new ConicetAuthenticationHandler("MyAuthenticationHandler", servicesManager, principalFactory, 1);
    • what is ConicetAuthenticationHandler?? is't the name of the custom authentication handler?
  • Also DONT use jdbc support dependency as this is going to use default jdbc AuthenticationHandler as well as yours.
    • BUT I need to authenticate against MySql database?!
Thanks again for your appreciated response,

I used to manage this whole thing nicely in previous versions!! BUT these whole new changes are not helping without a more detailed guide specially for whom are not JAVA oriented developers!!

Best regards,

Man H

unread,
Dec 11, 2017, 9:21:33 AM12/11/17
to cas-...@apereo.org
Hi,

my example is not intended to be docs replacement, nevertheless I try to answer your questions.

2017-12-11 4:45 GMT-03:00 noumann.f <noum...@gmail.com>:
Thanks,
There some points need explanation:
  • return new CConicetUtil(JpaBeans.newDataSource(query));
    • What're the MyUnit, and the CConicetUtil()? whats their purpose?!

The purpose of beeing there is to demonstrate how you can add your own beans, in this case the purpose is to register login time after autentication succeeded. This has a corresponding entry in workflow. In other words dont bother about this.
 
  • - JdbcAuthenticationProperties.Query query = casProperties.getAuthn().getJdbc().getQuery().get(0);
    • in here, doesn't this mean that we are still using the Query properties! where I need to use custom properties?

I am using Cas infrastructure, but of course you could use whatever system  you like to load properties in it. Since I am defining a JDBC Auithentication Handler it seems reasonable for me if I use cas jdbc authentication properties.

 
  •  final ConicetAuthenticationHandler handler = new ConicetAuthenticationHandler("MyAuthenticationHandler", servicesManager, principalFactory, 1);
    • what is ConicetAuthenticationHandler?? is't the name of the custom authentication handler?


Yes.

  • Also DONT use jdbc support dependency as this is going to use default jdbc AuthenticationHandler as well as yours.
    • BUT I need to authenticate against MySql database?!

This is done by MyAuthenticationHandler. I didnt show complete code, but as you can see the handler has been provided with capacity to handle authentication (Datasource, password encoding etc).


Thanks again for your appreciated response,

I used to manage this whole thing nicely in previous versions!! BUT these whole new changes are not helping without a more detailed guide specially for whom are not JAVA oriented developers!!


I did the same as you in previous versions, but doing it that way would requiere modifying overlay with each release change, whereas now you have code independency.
My original code has not changed that much, Authentication Handler is still the same, the only new thing is that you have to register it.


Regards
 

Best regards,

On Wednesday, December 6, 2017 at 11:18:28 PM UTC+2, noumann.f wrote:
Hi,

I need to create a custom JDBC authentication handler, I'd done this previously with version 4.x but with new version 5.1.x things have changed !!

but I need more details about registering the new handler and how to create special properties for it in the cas.properties and then reach them in the code!

Best regards,

--
- 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+unsubscribe@apereo.org.

noumann.f

unread,
Dec 11, 2017, 9:51:03 AM12/11/17
to CAS Community
Thanks again for your patience,

My real problem is that the custom code I put in the src/main/java is being compiled but not executed!

In other word the server didn't reach the customization code I'm making even when I add these to the properties file:

cas.authn.policy.requiredHandlerAuthenticationPolicyEnabled=true
cas
.authn.policy.req.tryAll=false
cas
.authn.policy.req.handlerName=FileAuthenticationHandler
cas
.authn.policy.req.enabled=true

I gave up the JDBC handler for now, and trying to make a simpler one like customizing the FileAuthenticationHandler, just copying the structure and the code into custom ones and trying to operate it.

And still facing the same problem, it isn't running my custom registration and handler, it runs the generic file ones!!!

Authentication Handler:
package org.custom;

// imports are copied from the original files

public class CustomFileAuthenticationHandler extends AbstractUsernamePasswordAuthenticationHandler {
   
/** The default separator in the file. */
   
public static final String DEFAULT_SEPARATOR = "::";

   
/** The separator to use. */
   
private final String separator;

   
/** The filename to read the list of usernames from. */
   
private final Resource fileName;

   
public CustomFileAuthenticationHandler(final String name, final ServicesManager servicesManager, final PrincipalFactory principalFactory,
                                     
final Resource fileName, final String separator) {
       
super(name, servicesManager, principalFactory, null);
       
this.fileName = fileName;
       
this.separator = separator;
   
}

   
@Override
   
protected HandlerResult authenticateUsernamePasswordInternal(final UsernamePasswordCredential transformedCredential,
                                                                 
final String originalPassword)
           
throws GeneralSecurityException, PreventedException {
       
try {
           
if (this.fileName == null) {
               
throw new FileNotFoundException("Filename does not exist");
           
}
           
final String username = transformedCredential.getUsername();
           
final String passwordOnRecord = getPasswordOnRecord(username);
           
if (StringUtils.isBlank(passwordOnRecord)) {
               
throw new AccountNotFoundException(username + " not found in backing file.");
           
}
           
if (matches(originalPassword, passwordOnRecord)) {
               
return createHandlerResult(transformedCredential, this.principalFactory.createPrincipal(username), null);
           
}
       
} catch (final IOException e) {
           
throw new PreventedException("IO error reading backing file", e);
       
}
       
throw new FailedLoginException();
   
}
   
   
/**
     * Gets the password on record.
     *
     * @param username the username
     * @return the password on record
     * @throws IOException Signals that an I/O exception has occurred.
     */

   
private String getPasswordOnRecord(final String username) throws IOException {
       
return Files.lines(fileName.getFile().toPath())
               
.map(line -> line.split(this.separator))
               
.filter(lineFields -> {
                   
final String userOnRecord = lineFields[0];
                   
return username.equals(userOnRecord);
               
})
               
.map(lineFields -> lineFields[1])
               
.findFirst()
               
.orElse(null);
   
}
}


Registration class:


package org.custom;

// imports are copied from the original

@Configuration("customFileAuthenticationEventExecutionPlanConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
public class CustomFileAuthenticationEventExecutionPlanConfiguration implements AuthenticationEventExecutionPlanConfigurer {
   
private static final Logger LOGGER = LoggerFactory.getLogger(CustomFileAuthenticationEventExecutionPlanConfiguration.class);

   
@Autowired(required = false)
   
@Qualifier("customFilePasswordPolicyConfiguration")
   
private PasswordPolicyConfiguration customFilePasswordPolicyConfiguration;


   
@Autowired
   
@Qualifier("servicesManager")
   
private ServicesManager servicesManager;
   
   
@Autowired

   
private CasConfigurationProperties casProperties;

   
   
@Autowired
   
@Qualifier("personDirectoryPrincipalResolver")
   
private PrincipalResolver personDirectoryPrincipalResolver;


   
@ConditionalOnMissingBean(name = "filePrincipalFactory")
   
@Bean
   
public PrincipalFactory filePrincipalFactory() {
       
return new DefaultPrincipalFactory();
   
}

   
@RefreshScope
   
@Bean
   
public AuthenticationHandler customFileAuthenticationHandler() {
       
final FileAuthenticationProperties fileProperties = casProperties.getAuthn().getFile();
       
final FileAuthenticationHandler h = new FileAuthenticationHandler(fileProperties.getName(), servicesManager, filePrincipalFactory(),
                fileProperties
.getFilename(), fileProperties.getSeparator());


        h
.setPasswordEncoder(Beans.newPasswordEncoder(fileProperties.getPasswordEncoder()));
       
if (customFilePasswordPolicyConfiguration != null) {
            h
.setPasswordPolicyConfiguration(customFilePasswordPolicyConfiguration);
       
}
        h
.setPrincipalNameTransformer(Beans.newPrincipalNameTransformer(fileProperties.getPrincipalTransformation()));

       
return h;

   
}
   
   
@Override
   
public void configureAuthenticationExecutionPlan(final AuthenticationEventExecutionPlan plan) {

       
if (casProperties.getAuthn().getFile().getFilename() != null) {
            LOGGER
.debug("zzz Added file-based authentication handler");
            plan
.registerAuthenticationHandlerWithPrincipalResolver(customFileAuthenticationHandler(), personDirectoryPrincipalResolver);
       
}
   
}
}


CAS Properties:
cas.authn.file.separator=::
cas
.authn.file.filename=file:///etc/cas/usersfile
cas
.authn.file.name=usersfile

....

cas
.authn.policy.requiredHandlerAuthenticationPolicyEnabled=true
cas
.authn.policy.req.tryAll=false
cas
.authn.policy.req.handlerName=CustomFileAuthenticationHandler
cas
.authn.policy.req.enabled=true


On Wednesday, December 6, 2017 at 11:18:28 PM UTC+2, noumann.f wrote:

noumann.f

unread,
Dec 11, 2017, 9:57:55 AM12/11/17
to CAS Community
The registration class in the previous post isn't complete, here it is:

Registration class:
package org.custom;

// imports copied from the original code


cas.properites file

#File Authentication
##################################################
cas
.authn.file.separator=::
cas
.authn.file.filename=file:///etc/cas/usersfile
cas
.authn.file.name=usersfile

...

cas.authn.policy.requiredHandlerAuthenticationPolicyEnabled=true
cas
.authn.policy.req.tryAll=false
cas
.authn.policy.req.handlerName=CustomFileAuthenticationHandler
cas
.authn.policy.req.enabled=true

On Wednesday, December 6, 2017 at 11:18:28 PM UTC+2, noumann.f wrote:

Robert Oschwald

unread,
Dec 11, 2017, 10:10:48 AM12/11/17
to cas-...@apereo.org
By default, CAS scans only the org.apereo.cas.config package, so you config bean is not picked up.
You can either move the config bean to the org.apereo.cas.config package, or you register your Config bean.


--
- 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/2b3377eb-0d7d-4e63-bd09-36d6432c2a2d%40apereo.org.

Juan Quintanilla

unread,
Dec 11, 2017, 1:24:56 PM12/11/17
to cas-...@apereo.org

Hi,


I'm running CAS 5.1.2 using tomcat 8.5 and java 8 and trying to configure the Oracle JPA ticket registry but running into issues. I have been able to configure this with CAS 4 and CAS 3 in the past but for some reason I'm encountering the error below:


2017-12-11 13:07:04,885 WARN [com.zaxxer.hikari.util.DriverDataSource] - <Registered driver with driverClassName=oracle.jdbc.driver.OracleDriver was not found, trying direct instantiation.>
2017-12-11 13:07:05,463 ERROR [com.zaxxer.hikari.pool.PoolBase] - <HikariPool-1 - Failed to execute connection test query (ORA-00923: FROM keyword not found where expected
).>
2017-12-11 13:07:05,465 ERROR [com.zaxxer.hikari.pool.HikariPool] - <HikariPool-1 - Exception during pool initialization.>
java.sql.SQLSyntaxErrorException: ORA-00923: FROM keyword not found where expected

        at oracle.jdbc.driver.T4CTTIoer11.processError(T4CTTIoer11.java:494) ~[ojdbc8-12.2.0.1.0.jar:12.2.0.1.0]



I verified that the ojdbc8 is in both the tomcat lib folder and in the cas lib folder.


I have configured my pom.xml as follows and setup the cas.properties file with the configuration below:


pom.xml

      <dependency>
          <groupId>org.apereo.cas</groupId>
          <artifactId>cas-server-support-jpa-ticket-registry</artifactId>
          <version>${cas.version}</version>
      </dependency>

     <dependency>
         <groupId>com.oracle</groupId>
         <artifactId>ojdbc8</artifactId>
         <version>12.2.0.1.0</version>
         <scope>runtime</scope>
     </dependency>
     <dependency>
        <groupId>org.apereo.cas</groupId>
        <artifactId>cas-server-support-jdbc-drivers</artifactId>
        <version>${cas.version}</version>
     </dependency>



cas.properties

cas.serviceRegistry.jpa.isolateInternalQueries=false
cas.serviceRegistry.jpa.url=jdbc:oracle:thin:XXXX
cas.serviceRegistry.jpa.failFast=true
cas.serviceRegistry.jpa.dialect=org.hibernate.dialect.Oracle12cDialect
cas.serviceRegistry.jpa.leakThreshold=10
cas.serviceRegistry.jpa.batchSize=1
cas.serviceRegistry.jpa.user=XXXX
cas.serviceRegistry.jpa.ddlAuto=create-drop
cas.serviceRegistry.jpa.password=XXXX
cas.serviceRegistry.jpa.autocommit=false
cas.serviceRegistry.jpa.driverClass=oracle.jdbc.driver.OracleDriver
cas.serviceRegistry.jpa.idleTimeout=5000
cas.serviceRegistry.jpa.dataSourceName=
cas.serviceRegistry.jpa.dataSourceProxy=false

cas.serviceRegistry.jpa.pool.suspension=false
cas.serviceRegistry.jpa.pool.minSize=6
cas.serviceRegistry.jpa.pool.maxSize=18
cas.serviceRegistry.jpa.pool.maxWait=2000


Just wanted to see if anyone else has run into a similar issue.


Thanks!


___________________
Juan Quintanilla


Man H

unread,
Dec 11, 2017, 1:29:56 PM12/11/17
to cas-...@apereo.org
I create a separate jar which I make part of cas overlay through maven dependency, which in turn is detected through src/webapp/META-INF/spring.factories put in overlay with content:

org.springframework.boot.autoconfigure.EnableAutoConfiguration=my.domain.apps.cas.MyAuthenticationEventExecutionPlanConfiguration

Following is the pom for that jar:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd ">
    <modelVersion>4.0.0</modelVersion>
    <groupId>my.domain.libs</groupId>
    <artifactId>cas-server-my-support-jdbc</artifactId>
    <name>support-jdbc</name>
    <packaging>jar</packaging>
   
    <properties>
        <cas.version>5.1.0</cas.version>
        <springboot.version>1.5.3.RELEASE</springboot.version>
         <!-- app.server could be -jetty, -undertow, -tomcat, or blank if you plan to provide appserver -->
        <app.server></app.server>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>


   
    <dependencies>
        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-core-authentication</artifactId>

        </dependency>
       
        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-core-configuration</artifactId>

        </dependency>
       
        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-core-webflow</artifactId>

            <version>${cas.version}</version>
           
        </dependency>
       
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.rimerosolutions.maven.plugins</groupId>
                <artifactId>wrapper-maven-plugin</artifactId>
                <version>0.0.4</version>
                <configuration>
                    <verifyDownload>true</verifyDownload>
                    <checksumAlgorithm>MD5</checksumAlgorithm>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${springboot.version}</version>
                <configuration>
                    <mainClass>org.springframework.boot.loader.WarLauncher</mainClass>
                    <addResources>true</addResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <warName>cas</warName>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <recompressZippedFiles>false</recompressZippedFiles>
                    <archive>
                        <compress>false</compress>
                        <manifestFile>${project.build.directory}/war/work/org.apereo.cas/cas-server-webapp/META-INF/MANIFEST.MF
                        </manifestFile>
                    </archive>
                    <overlays>
                        <overlay>
                            <groupId>org.apereo.cas</groupId>
                            <artifactId>cas-server-webapp</artifactId>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                </plugin>
        </plugins>
        <finalName>cas-server-support-jdbc-conicet</finalName>
    </build>

    <repositories>
        <repository>
            <id>sonatype-releases</id>
            <url>http://oss.sonatype.org/content/repositories/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>shibboleth-releases</id>
            <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <url>https://repo.spring.io/milestone</url>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <id>pgp</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.s4u.plugins</groupId>
                        <artifactId>pgpverify-maven-plugin</artifactId>
                        <version>1.1.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <pgpKeyServer>hkp://pool.sks-keyservers.net</pgpKeyServer>
                            <pgpKeysCachePath>${settings.localRepository}/pgpkeys-cache</pgpKeysCachePath>
                            <scope>test</scope>
                            <verifyPomFiles>true</verifyPomFiles>
                            <failNoSignature>false</failNoSignature>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>


--
- 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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/d9bf60e4-910c-4518-987d-a3547bc18bb5%40apereo.org.

noumann.f

unread,
Dec 11, 2017, 2:54:07 PM12/11/17
to CAS Community
Hi,

I'd already registered my configuration class like described in the article here:

and here is my version:
src/
└── main
    ├── java
    │   └── org
    │       └── custom
    │           ├── config
    │           │   └── CustomFileAuthenticationEventExecutionPlanConfiguration.java
    │           └── CustomFileAuthenticationHandler.java
    └── resources
        └── META-INF
            └── spring.factories
in the spring.factories I put:
org.springframework.boot.autoconfigure.EnableAutoConfiguration=org.custom.CustomFileAuthenticationEventExecutionPlanConfiguration

Ray Bon

unread,
Dec 11, 2017, 6:12:36 PM12/11/17
to cas-...@apereo.org
To read custom config, you need to create a configuration properties file. See

org.apereo.cas.configuration.CasConfigurationProperties

for ideas.

Ray
-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

Man H

unread,
Dec 11, 2017, 6:29:24 PM12/11/17
to cas-...@apereo.org
Hi



1. Could you enable debug in log to see if at startup of cas your registered handler is beeing configured.?

2. You  can also debug your code in order to see if it is beeing reached.

My cas is deployed on tomcat.







To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/83f09f35-9085-4170-9ae0-bcf8bdd4e6d6%40apereo.org.

Man H

unread,
Dec 11, 2017, 6:37:54 PM12/11/17
to cas-...@apereo.org
Another issue regarding your comments on which handlers are used I recommend not using dependencies of handlers you are customizing. i.e with jdbc dont use jdbc-support dependency as this is going to setup Cas jdbc implementation. That is why you use order as one of your handlers constructor parameter, which is telling cas in which order you want to use handlers.

noumann.f

unread,
Dec 12, 2017, 2:40:41 AM12/12/17
to CAS Community
Hi,

Yes, I'm running in debug mode, below the log.

And about debugging the code, I'm working on it, but in general I'm not a Java developer but this CAS good reputation brought me here!

log.cas

2017-12-12 09:33:06,558 INFO [org.apereo.cas.web.CasWebApplication] - <The following profiles are active: standalone>
2017-12-12 09:33:06,701 INFO [org.apereo.cas.web.CasWebApplicationContext] - <Refreshing CasWebApplicationContext>
2017-12-12 09:33:06,706 DEBUG [org.apereo.cas.web.CasWebApplicationContext] - <Bean factory for org.apereo.cas.web.CasWebApplicationContext@158da8e: org.springframework.beans.factory.support.DefaultListableBeanFactory@4c583ecf: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.context.event.internalEventListenerProcessor,org.springframework.context.event.internalEventListenerFactory,casWebApplication]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@6950e31>
2017-12-12 09:33:12,859 WARN [org.apereo.cas.config.CasCoreTicketsConfiguration] - <Runtime memory is used as the persistence storage for retrieving and managing tickets. Tickets that are issued during runtime will be LOST upon container restarts. This MAY impact SSO functionality.>
2017-12-12 09:33:12,889 DEBUG [org.apereo.cas.configuration.support.Beans] - <Ticket registry encryption/signing is turned off. This MAY NOT be safe in a clustered production environment. Consider using other choices to handle encryption, signing and verification of ticket registry tickets, and verify the chosen ticket registry does support this behavior.>
2017-12-12 09:33:14,317 DEBUG [org.apereo.cas.web.CasWebApplicationContext] - <Using MessageSource [org.apereo.cas.web.view.CasReloadableMessageBundle: basenames=[classpath:custom_messages, classpath:messages]]>
2017-12-12 09:33:14,317 DEBUG [org.apereo.cas.web.CasWebApplicationContext] - <Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@24855019]>
2017-12-12 09:33:28,100 DEBUG [org.apereo.cas.config.CasConfigurationSupportUtilitiesConfiguration] - <Starting to watch configuration directory [/etc/cas/config]>
2017-12-12 09:33:28,595 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [FileAuthenticationEventExecutionPlanConfiguration]>
2017-12-12 09:33:28,595 DEBUG [org.apereo.cas.adaptors.generic.config.FileAuthenticationEventExecutionPlanConfiguration] - <Added file-based authentication handler>
2017-12-12 09:33:28,607 DEBUG [org.apereo.cas.configuration.support.Beans] - <No password encoder shall be created given the requested encoder type [NONE]>
2017-12-12 09:33:28,648 DEBUG [org.apereo.cas.authentication.DefaultAuthenticationEventExecutionPlan] - <Registering handler [usersfile] principal resolver [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver@578a9032[chain=[org.apereo.cas.authentication.principal.resolvers.EchoingPrincipalResolver@2f977feb[]]]] into the execution plan>
2017-12-12 09:33:28,648 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [RejectUsersAuthenticationEventExecutionPlanConfiguration]>
2017-12-12 09:33:28,648 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [ShiroAuthenticationEventExecutionPlanConfiguration]>
2017-12-12 09:33:28,649 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [CasCoreAuthenticationHandlersConfiguration]>
2017-12-12 09:33:28,660 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [CasCoreAuthenticationHandlersConfiguration]>
2017-12-12 09:33:28,686 DEBUG [org.apereo.cas.authentication.DefaultAuthenticationEventExecutionPlan] - <Registering handler [HttpBasedServiceCredentialsAuthenticationHandler] principal resolver [org.apereo.cas.authentication.principal.resolvers.ProxyingPrincipalResolver@51e0301d[]] into the execution plan>
2017-12-12 09:33:28,686 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [CasCoreAuthenticationMetadataConfiguration]>
2017-12-12 09:33:28,698 DEBUG [org.apereo.cas.authentication.DefaultAuthenticationEventExecutionPlan] - <Registering metadata populator [org.apereo.cas.authentication.metadata.SuccessfulHandlerMetaDataPopulator@51dbd6e4[order=-2147483648]] into the execution plan>
2017-12-12 09:33:28,715 DEBUG [org.apereo.cas.authentication.DefaultAuthenticationEventExecutionPlan] - <Registering metadata populator [org.apereo.cas.authentication.metadata.RememberMeAuthenticationMetaDataPopulator@5f13be1[order=-2147483648]] into the execution plan>
2017-12-12 09:33:28,716 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [AcceptUsersAuthenticationEventExecutionPlanConfiguration]>
2017-12-12 09:33:28,716 DEBUG [org.apereo.cas.config.CasCoreAuthenticationConfiguration] - <Configuring authentication execution plan [CustomFileAuthenticationEventExecutionPlanConfiguration]>
2017-12-12 09:33:28,722 DEBUG [org.apereo.cas.configuration.support.Beans] - <No password encoder shall be created given the requested encoder type [NONE]>
2017-12-12 09:33:28,724 DEBUG [org.apereo.cas.authentication.DefaultAuthenticationEventExecutionPlan] - <Registering handler [usersfile] principal resolver [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver@578a9032[chain=[org.apereo.cas.authentication.principal.resolvers.EchoingPrincipalResolver@2f977feb[]]]] into the execution plan>
2017-12-12 09:33:29,142 DEBUG [org.apereo.cas.config.CasCoreTicketsConfiguration] - <Ticket-granting ticket expiration policy is based on hard/idle timeouts of [28800]/[7200] seconds>
2017-12-12 09:33:29,247 DEBUG [org.apereo.cas.config.CasCoreConfiguration] - <Configuring authentication request service selection strategy plan [CasCoreAuthenticationServiceSelectionStrategyConfiguration]>
2017-12-12 09:33:29,504 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Final list of attribute repositories is [[]]>
2017-12-12 09:33:29,506 DEBUG [org.apereo.cas.config.CasCoreAuthenticationPrincipalConfiguration] - <Attribute repository sources are not available for principal resolution so principal resolver will echo back the principal resolved during authentication directly.>
2017-12-12 09:33:29,692 WARN [org.apereo.cas.config.CasCoreServicesConfiguration] - <Runtime memory is used as the persistence storage for retrieving and persisting service definitions. Changes that are made to service definitions during runtime WILL be LOST upon container restarts.>
2017-12-12 09:33:29,715 DEBUG [org.apereo.cas.services.ServiceRegistryInitializer] - <Service registry contains [0] service definitions>
2017-12-12 09:33:29,715 INFO [org.apereo.cas.services.ServiceRegistryInitializer] - <The service registry database will not be initialized from default JSON services. If the service registry database ends up empty, CAS will refuse to authenticate services until service definitions are added to the registry. To auto-initialize the service registry, set 'cas.serviceRegistry.initFromJson=true' in your CAS settings.>
2017-12-12 09:33:29,860 DEBUG [org.apereo.cas.config.CasCoreTicketsConfiguration] - <Configuring ticket metadata registration plan [CasCoreTicketCatalogConfiguration]>
2017-12-12 09:33:29,860 DEBUG [org.apereo.cas.config.CasCoreTicketCatalogConfiguration] - <Registering core CAS protocol ticket definitions...>
2017-12-12 09:33:29,862 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Locating ticket definition for [PT]>
2017-12-12 09:33:29,864 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Registering/Updating ticket definition [org.apereo.cas.ticket.DefaultTicketDefinition@4b7bbcae[implementationClass=class org.apereo.cas.ticket.ProxyTicketImpl,prefix=PT]]>
2017-12-12 09:33:29,864 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Locating ticket definition for [ST]>
2017-12-12 09:33:29,864 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Registering/Updating ticket definition [org.apereo.cas.ticket.DefaultTicketDefinition@5c8fe821[implementationClass=class org.apereo.cas.ticket.ServiceTicketImpl,prefix=ST]]>
2017-12-12 09:33:29,865 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Locating ticket definition for [PGT]>
2017-12-12 09:33:29,865 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Registering/Updating ticket definition [org.apereo.cas.ticket.DefaultTicketDefinition@7cd5ab7[implementationClass=class org.apereo.cas.ticket.ProxyGrantingTicketImpl,prefix=PGT]]>
2017-12-12 09:33:29,865 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Locating ticket definition for [TGT]>
2017-12-12 09:33:29,865 DEBUG [org.apereo.cas.ticket.DefaultTicketCatalog] - <Registering/Updating ticket definition [org.apereo.cas.ticket.DefaultTicketDefinition@71f15c09[implementationClass=class org.apereo.cas.ticket.TicketGrantingTicketImpl,prefix=TGT]]>
2017-12-12 09:33:29,912 DEBUG [org.apereo.cas.config.CasCoreTicketsSchedulingConfiguration] - <Ticket registry cleaner is enabled>
2017-12-12 09:33:30,910 DEBUG [org.apereo.cas.logout.config.CasCoreLogoutConfiguration] - <Configuring logout execution plan [CasCoreLogoutConfiguration]>
2017-12-12 09:33:30,955 DEBUG [org.apereo.cas.monitor.config.CasCoreMonitorConfiguration] - <Configured memory monitor with free-memory threshold [10]>
2017-12-12 09:33:30,956 DEBUG [org.apereo.cas.monitor.config.CasCoreMonitorConfiguration] - <Configured session monitor with service ticket threshold [5000] and session threshold [10000]>
2017-12-12 09:33:32,256 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [AuthenticationEvents] is undefined. Checking defaults...>
2017-12-12 09:33:32,257 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [AuthenticationEvents] is set to [true]>
2017-12-12 09:33:32,257 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [AuthenticationEvents] is undefined. Checking defaults...>
2017-12-12 09:33:32,257 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [AuthenticationEvents] is set to [false]>
2017-12-12 09:33:32,257 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [AuthenticationEvents] is [false].>
2017-12-12 09:33:34,180 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [Dashboard] is undefined. Checking defaults...>
2017-12-12 09:33:34,181 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [Dashboard] is set to [true]>
2017-12-12 09:33:34,181 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [Dashboard] is undefined. Checking defaults...>
2017-12-12 09:33:34,181 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [Dashboard] is set to [false]>
2017-12-12 09:33:34,182 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [Dashboard] is [false].>
2017-12-12 09:33:34,254 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [AttributeResolution] is undefined. Checking defaults...>
2017-12-12 09:33:34,255 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [AttributeResolution] is set to [true]>
2017-12-12 09:33:34,255 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [AttributeResolution] is undefined. Checking defaults...>
2017-12-12 09:33:34,256 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [AttributeResolution] is set to [false]>
2017-12-12 09:33:34,256 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [AttributeResolution] is [false].>
2017-12-12 09:33:34,270 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [ConfigurationState] is undefined. Checking defaults...>
2017-12-12 09:33:34,271 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [ConfigurationState] is set to [true]>
2017-12-12 09:33:34,271 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [ConfigurationState] is undefined. Checking defaults...>
2017-12-12 09:33:34,272 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [ConfigurationState] is set to [false]>
2017-12-12 09:33:34,272 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [ConfigurationState] is [false].>
2017-12-12 09:33:34,330 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [Status] is undefined. Checking defaults...>
2017-12-12 09:33:34,331 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [Status] is set to [true]>
2017-12-12 09:33:34,331 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [Status] is undefined. Checking defaults...>
2017-12-12 09:33:34,331 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [Status] is set to [false]>
2017-12-12 09:33:34,332 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [Status] is [false].>
2017-12-12 09:33:34,351 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [SingleSignOnReport] is undefined. Checking defaults...>
2017-12-12 09:33:34,351 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [SingleSignOnReport] is set to [true]>
2017-12-12 09:33:34,352 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [SingleSignOnReport] is undefined. Checking defaults...>
2017-12-12 09:33:34,352 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [SingleSignOnReport] is set to [false]>
2017-12-12 09:33:34,353 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [SingleSignOnReport] is [false].>
2017-12-12 09:33:34,380 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [LoggingConfig] is undefined. Checking defaults...>
2017-12-12 09:33:34,381 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [LoggingConfig] is set to [true]>
2017-12-12 09:33:34,381 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [LoggingConfig] is undefined. Checking defaults...>
2017-12-12 09:33:34,384 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [LoggingConfig] is set to [false]>
2017-12-12 09:33:34,385 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [LoggingConfig] is [false].>
2017-12-12 09:33:34,400 DEBUG [org.apereo.cas.web.report.util.ControllerUtils] - <Located logging configuration reference in the environment as [file:/etc/cas/config/log4j2.xml]>
2017-12-12 09:33:34,401 DEBUG [org.apereo.cas.web.report.util.ControllerUtils] - <Loaded logging configuration resource [URL [file:/etc/cas/config/log4j2.xml]]. Initializing logger context...>
2017-12-12 09:33:34,454 DEBUG [org.apereo.cas.web.report.util.ControllerUtils] - <Installing log configuration listener to detect changes and update>
2017-12-12 09:33:34,471 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [SingleSignOnStatus] is undefined. Checking defaults...>
2017-12-12 09:33:34,471 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [SingleSignOnStatus] is set to [true]>
2017-12-12 09:33:34,471 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [SingleSignOnStatus] is undefined. Checking defaults...>
2017-12-12 09:33:34,471 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [SingleSignOnStatus] is set to [false]>
2017-12-12 09:33:34,472 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [SingleSignOnStatus] is [false].>
2017-12-12 09:33:34,485 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [SpringWebflowReport] is undefined. Checking defaults...>
2017-12-12 09:33:34,485 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [SpringWebflowReport] is set to [true]>
2017-12-12 09:33:34,485 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [SpringWebflowReport] is undefined. Checking defaults...>
2017-12-12 09:33:34,486 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [SpringWebflowReport] is set to [false]>
2017-12-12 09:33:34,486 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [SpringWebflowReport] is [false].>
2017-12-12 09:33:34,505 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [Statistics] is undefined. Checking defaults...>
2017-12-12 09:33:34,505 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [Statistics] is set to [true]>
2017-12-12 09:33:34,505 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [Statistics] is undefined. Checking defaults...>
2017-12-12 09:33:34,505 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [Statistics] is set to [false]>
2017-12-12 09:33:34,505 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [Statistics] is [false].>
2017-12-12 09:33:34,560 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Sensitivity for endpoint [Metrics] is undefined. Checking defaults...>
2017-12-12 09:33:34,560 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default sensitivity for endpoint [Metrics] is set to [true]>
2017-12-12 09:33:34,560 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Capability for endpoint [Metrics] is undefined. Checking defaults...>
2017-12-12 09:33:34,561 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Default capability for endpoint [Metrics] is set to [false]>
2017-12-12 09:33:34,561 DEBUG [org.apereo.cas.web.report.BaseCasMvcEndpoint] - <Finalized capability for endpoint [Metrics] is [false].>
2017-12-12 09:33:35,821 DEBUG [org.apereo.cas.support.events.listener.CasConfigurationEventListener] - <Received event [org.springframework.cloud.context.environment.EnvironmentChangeEvent[source=[]]]>
2017-12-12 09:33:35,822 INFO [org.apereo.cas.support.events.listener.CasConfigurationEventListener] - <Refreshing CAS configuration. Stand by...>
2017-12-12 09:33:35,823 DEBUG [org.apereo.cas.configuration.CasConfigurationPropertiesEnvironmentManager] - <Reloading CAS configuration via [cas-org.apereo.cas.configuration.CasConfigurationProperties]>
2017-12-12 09:33:35,950 DEBUG [org.apereo.cas.configuration.CasConfigurationPropertiesEnvironmentManager] - <Reloaded CAS configuration [cas-org.apereo.cas.configuration.CasConfigurationProperties]>
2017-12-12 09:33:36,179 DEBUG [org.apereo.cas.web.CasWebApplicationContext] - <Unable to locate LifecycleProcessor with name 'lifecycleProcessor': using default [org.springframework.context.support.DefaultLifecycleProcessor@7951c3a2]>
2017-12-12 09:33:36,193 DEBUG [org.apereo.cas.configuration.support.Beans] - <No password encoder shall be created given the requested encoder type [NONE]>
2017-12-12 09:33:36,213 DEBUG [org.apereo.cas.util.ResourceUtils] - <No resource defined to prepare. Returning null>
2017-12-12 09:33:36,213 DEBUG [org.apereo.cas.adaptors.generic.ShiroAuthenticationHandler] - <Shiro configuration is not defined>
2017-12-12 09:33:36,213 DEBUG [org.apereo.cas.configuration.support.Beans] - <No password encoder shall be created given the requested encoder type [NONE]>
2017-12-12 09:33:36,226 DEBUG [org.apereo.cas.configuration.support.Beans] - <No password encoder shall be created given the requested encoder type [NONE]>
2017-12-12 09:33:36,332 DEBUG [org.apereo.cas.services.DefaultServicesManager] - <Loading services from [InMemoryServiceRegistry]>
2017-12-12 09:33:36,336 INFO [org.apereo.cas.services.DefaultServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>
2017-12-12 09:33:36,379 DEBUG [org.apereo.cas.config.CasCoreTicketsConfiguration] - <Protocol tickets generated by CAS are not signed/encrypted.>
2017-12-12 09:33:36,401 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <Configured merging strategy for attribute sources is [REPLACE]>
2017-12-12 09:33:36,405 DEBUG [org.apereo.cas.config.CasPersonDirectoryConfiguration] - <No attribute repository sources are available/defined to merge together.>
2017-12-12 09:33:36,749 DEBUG [org.apereo.cas.util.cipher.BaseStringCipherExecutor] - <Located encryption key to use for [Ticket-granting Cookie]>
2017-12-12 09:33:36,749 DEBUG [org.apereo.cas.util.cipher.BaseStringCipherExecutor] - <Located signing key to use for [Ticket-granting Cookie]>
2017-12-12 09:33:36,759 DEBUG [org.apereo.cas.util.cipher.BaseStringCipherExecutor] - <Initialized cipher encryption sequence via [A128CBC-HS256]>
2017-12-12 09:33:37,353 DEBUG [org.apereo.cas.web.report.util.ControllerUtils] - <Located logging configuration reference in the environment as [file:/etc/cas/config/log4j2.xml]>
2017-12-12 09:33:37,353 DEBUG [org.apereo.cas.web.report.util.ControllerUtils] - <Loaded logging configuration resource [URL [file:/etc/cas/config/log4j2.xml]]. Initializing logger context...>
2017-12-12 09:33:37,354 DEBUG [org.apereo.cas.web.report.util.ControllerUtils] - <Installing log configuration listener to detect changes and update>
2017-12-12 09:33:38,017 INFO [org.apereo.cas.support.events.listener.DefaultCasEventListener] - < [36m>
2017-12-12 09:33:38,024 INFO [org.apereo.cas.support.events.listener.DefaultCasEventListener] - <


  ____    _____      _      ____   __   __
 
|  _ \  | ____|    / \    |  _ \  \ \ / /
 
| |_) | |  _|     / _ \   | | | |  \ V /
 
|  _ <  | |___   / ___ \  | |_| |   | |  
 
|_| \_\ |_____| /_/   \_\ |____/    |_|  
                                         
>
2017-12-12 09:33:38,025 INFO [org.apereo.cas.support.events.listener.DefaultCasEventListener] - < [0m>
2017-12-12 09:33:38,025 INFO [org.apereo.cas.support.events.listener.DefaultCasEventListener] - <Ready to process requests @ [2017-12-12T07:33:38.016Z]>
2017-12-12 09:33:38,037 INFO [org.apereo.cas.web.CasWebApplication] - <Started CasWebApplication in 35.178 seconds (JVM running for 38.787)>
2017-12-12 09:33:57,439 DEBUG [org.apereo.cas.services.DefaultServicesManager] - <Loading services from [InMemoryServiceRegistry]>
2017-12-12 09:33:57,439 INFO [org.apereo.cas.services.DefaultServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>
2017-12-12 09:33:57,447 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Creating new transaction with name [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner.clean]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'ticketTransactionManager'>
.....




Man H

unread,
Dec 12, 2017, 8:50:47 AM12/12/17
to cas-...@apereo.org
Hi

I can see a lot of other handlers can you attach the log when authentication happens?

noumann.f

unread,
Dec 13, 2017, 4:24:30 AM12/13/17
to CAS Community
Sorry for being late to respond to you request, but the test machine I was working on broke  down suddenly!

below the log after authentication:

log.cas

2017-12-13 11:25:17,913 INFO [org.apereo.cas.support.events.listener.DefaultCasEventListener] - <



  ____    _____      _      ____   __   __
 
|  _ \  | ____|    / \    |  _ \  \ \ / /
 
| |_) | |  _|     / _ \   | | | |  \ V /
 
|  _ <  | |___   / ___ \  | |_| |   | |  
 
|_| \_\ |_____| /_/   \_\ |____/    |_|  
                                         
>
2017-12-13 11:25:17,914 INFO [org.apereo.cas.support.events.listener.DefaultCasEventListener] - < [0m>
2017-12-13 11:25:17,914 INFO [org.apereo.cas.support.events.listener.DefaultCasEventListener] - <Ready to process requests @ [2017-12-13T09:25:17.909Z]>
2017-12-13 11:25:17,915 INFO [org.apereo.cas.web.CasWebApplication] - <Started CasWebApplication in 27.184 seconds (JVM running for 29.605)>
2017-12-13 11:25:37,644 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Creating new transaction with name [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner.clean]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'ticketTransactionManager'>
2017-12-13 11:25:37,645 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Creating new transaction with name [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner.clean]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'ticketTransactionManager'>
2017-12-13 11:25:37,649 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Attempting to acquire ticket cleanup lock.>
2017-12-13 11:25:37,650 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Acquired lock. Proceeding with cleanup.>
2017-12-13 11:25:37,652 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <[0] expired tickets found.>
2017-12-13 11:25:37,652 INFO [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <[0] expired tickets removed.>
2017-12-13 11:25:37,652 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Releasing ticket cleanup lock.>
2017-12-13 11:25:37,652 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Finished ticket cleanup.>
2017-12-13 11:25:37,653 DEBUG [org.apereo.cas.services.DefaultServicesManager] - <Loading services from [InMemoryServiceRegistry]>
2017-12-13 11:25:37,653 INFO [org.apereo.cas.services.DefaultServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>
2017-12-13 11:25:37,658 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Initiating transaction commit>
2017-12-13 11:25:37,658 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Resuming suspended transaction after completion of inner transaction>
2017-12-13 11:25:37,659 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Initiating transaction commit>
2017-12-13 11:25:50,288 INFO [org.apereo.cas.web.flow.InitialFlowSetupAction] - <Setting path for cookies for warn cookie generator to: [/cas/] >
2017-12-13 11:25:50,294 DEBUG [org.apereo.cas.authentication.principal.WebApplicationServiceFactory] - <No service is specified in the request. Skipping service creation>
2017-12-13 11:25:50,295 DEBUG [org.apereo.cas.web.support.DefaultArgumentExtractor] - <No service could be extracted based on the given request>
2017-12-13 11:25:50,295 DEBUG [org.apereo.cas.web.support.AbstractArgumentExtractor] - <Extractor did not generate service.>
2017-12-13 11:25:50,319 DEBUG [org.apereo.cas.web.support.WebUtils] - <Evaluating request to determine if warning cookie should be generated>
2017-12-13 11:25:50,327 INFO [org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO
: audit:unknown
WHAT
: [event=success,timestamp=Wed Dec 13 11:25:50 EET 2017,source=RankedAuthenticationProviderWebflowEventResolver]
ACTION
: AUTHENTICATION_EVENT_TRIGGERED
APPLICATION
: CAS
WHEN
: Wed Dec 13 11:25:50 EET 2017
CLIENT IP ADDRESS
: 10.1.10.105
SERVER IP ADDRESS
: 10.1.15.57
=============================================================


>
2017-12-13 11:25:51,363 DEBUG [org.apereo.cas.authentication.principal.WebApplicationServiceFactory] - <No service is specified in the request. Skipping service creation>
2017-12-13 11:25:51,364 DEBUG [org.apereo.cas.web.support.DefaultArgumentExtractor] - <No service could be extracted based on the given request>
2017-12-13 11:25:51,364 DEBUG [org.apereo.cas.web.support.AbstractArgumentExtractor] - <Extractor did not generate service.>
2017-12-13 11:25:53,102 WARN [nz.net.ultraq.thymeleaf.expressions.ExpressionProcessor] - <Fragment expression "layout" is being wrapped as a Thymeleaf 3 fragment expression (~{...}) for backwards compatibility purposes.  This wrapping will be dropped in the next major version of the expression processor, so please rewrite as a Thymeleaf 3 fragment expression to future-proof your code.  See https://github.com/thymeleaf/thymeleaf/issues/451 for more information.>
2017-12-13 11:25:54,674 DEBUG [org.apereo.cas.web.view.CasReloadableMessageBundle] - <No properties file found for [classpath:custom_messages_en] - neither plain properties nor XML>
2017-12-13 11:25:54,676 DEBUG [org.apereo.cas.web.view.CasReloadableMessageBundle] - <No properties file found for [classpath:custom_messages] - neither plain properties nor XML>
2017-12-13 11:25:54,678 DEBUG [org.apereo.cas.web.view.CasReloadableMessageBundle] - <No properties file found for [classpath:messages_en] - neither plain properties nor XML>
2017-12-13 11:25:54,680 DEBUG [org.apereo.cas.web.view.CasReloadableMessageBundle] - <Loading properties [messages.properties] with encoding 'UTF-8'>
2017-12-13 11:26:37,654 DEBUG [org.apereo.cas.services.DefaultServicesManager] - <Loading services from [InMemoryServiceRegistry]>
2017-12-13 11:26:37,655 INFO [org.apereo.cas.services.DefaultServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>
2017-12-13 11:27:07,659 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Creating new transaction with name [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner.clean]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'ticketTransactionManager'>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Creating new transaction with name [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner.clean]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT; 'ticketTransactionManager'>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Attempting to acquire ticket cleanup lock.>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Acquired lock. Proceeding with cleanup.>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <[0] expired tickets found.>
2017-12-13 11:27:07,660 INFO [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <[0] expired tickets removed.>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Releasing ticket cleanup lock.>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.ticket.registry.DefaultTicketRegistryCleaner] - <Finished ticket cleanup.>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Initiating transaction commit>
2017-12-13 11:27:07,660 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Resuming suspended transaction after completion of inner transaction>
2017-12-13 11:27:07,661 DEBUG [org.apereo.cas.authentication.PseudoPlatformTransactionManager] - <Initiating transaction commit>
2017-12-13 11:27:37,655 DEBUG [org.apereo.cas.services.DefaultServicesManager] - <Loading services from [InMemoryServiceRegistry]>
2017-12-13 11:27:37,656 INFO [org.apereo.cas.services.DefaultServicesManager] - <Loaded [0] service(s) from [InMemoryServiceRegistry].>
2017-12-13 11:27:45,421 DEBUG [org.apereo.cas.authentication.adaptive.DefaultAdaptiveAuthenticationPolicy] - <Located client IP address as [10.1.10.105]>
2017-12-13 11:27:45,423 DEBUG [org.apereo.cas.authentication.adaptive.DefaultAdaptiveAuthenticationPolicy] - <User agent [Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0] is authorized to proceed>
2017-12-13 11:27:45,423 DEBUG [org.apereo.cas.authentication.adaptive.DefaultAdaptiveAuthenticationPolicy] - <Adaptive authentication policy has authorized client [10.1.10.105] to proceed.>
2017-12-13 11:27:45,424 DEBUG [org.apereo.cas.web.support.WebUtils] - <Evaluating request to determine if warning cookie should be generated>
2017-12-13 11:27:45,425 DEBUG [org.apereo.cas.web.support.WebUtils] - <Evaluating request to determine if warning cookie should be generated>
2017-12-13 11:27:48,936 DEBUG [org.apereo.cas.authentication.RegisteredServiceAuthenticationHandlerResolver] - <Authentication handlers used for this transaction are [HttpBasedServiceCredentialsAuthenticationHandlerusersfileusersfile]>
2017-12-13 11:27:48,948 DEBUG [org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler] - <Transforming credential username via [org.apereo.cas.configuration.support.Beans$$Lambda$51/1802029863]>
2017-12-13 11:27:48,949 DEBUG [org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler] - <Attempting to encode credential password via [org.springframework.security.crypto.password.NoOpPasswordEncoder] for [scott]>
2017-12-13 11:27:48,949 DEBUG [org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler] - <Attempting authentication internally for transformed credential [scott]>
2017-12-13 11:27:48,972 DEBUG [org.apereo.cas.authentication.AbstractAuthenticationManager] - <Authentication handler [usersfile] successfully authenticated [scott]>
2017-12-13 11:27:48,975 DEBUG [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver] - <Invoking principal resolver [org.apereo.cas.authentication.principal.resolvers.EchoingPrincipalResolver@6976f5ad[]]>
2017-12-13 11:27:48,977 DEBUG [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver] - <Resolved principal [scott]>
2017-12-13 11:27:48,979 DEBUG [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver] - <Final principal constructed by the chain of resolvers is [scott]>
2017-12-13 11:27:48,979 DEBUG [org.apereo.cas.authentication.AbstractAuthenticationManager] - <[org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver@59ca2895[chain=[org.apereo.cas.authentication.principal.resolvers.EchoingPrincipalResolver@6976f5ad[]]]] resolved [scott] from [scott]>
2017-12-13 11:27:48,980 DEBUG [org.apereo.cas.authentication.AbstractAuthenticationManager] - <Final principal resolved for this authentication event is [scott]>
2017-12-13 11:27:48,982 DEBUG [org.apereo.cas.authentication.policy.RequiredHandlerAuthenticationPolicy] - <Examining authentication successes for authentication handler [CustomFileAuthenticationHandler]>
2017-12-13 11:27:48,984 WARN [org.apereo.cas.authentication.policy.RequiredHandlerAuthenticationPolicy] - <Required authentication handler [CustomFileAuthenticationHandler] is not present in the list of recorded successful authentications>
2017-12-13 11:27:48,984 DEBUG [org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler] - <Transforming credential username via [org.apereo.cas.configuration.support.Beans$$Lambda$51/1802029863]>
2017-12-13 11:27:48,985 DEBUG [org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler] - <Attempting to encode credential password via [org.springframework.security.crypto.password.NoOpPasswordEncoder] for [scott]>
2017-12-13 11:27:48,985 DEBUG [org.apereo.cas.authentication.handler.support.AbstractUsernamePasswordAuthenticationHandler] - <Attempting authentication internally for transformed credential [scott]>
2017-12-13 11:27:48,986 DEBUG [org.apereo.cas.authentication.AbstractAuthenticationManager] - <Authentication handler [usersfile] successfully authenticated [scott]>
2017-12-13 11:27:48,987 DEBUG [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver] - <Invoking principal resolver [org.apereo.cas.authentication.principal.resolvers.EchoingPrincipalResolver@6976f5ad[]]>
2017-12-13 11:27:48,988 DEBUG [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver] - <Resolved principal [scott]>
2017-12-13 11:27:48,988 DEBUG [org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver] - <Final principal constructed by the chain of resolvers is [scott]>
2017-12-13 11:27:48,989 DEBUG [org.apereo.cas.authentication.AbstractAuthenticationManager] - <[org.apereo.cas.authentication.principal.resolvers.ChainingPrincipalResolver@59ca2895[chain=[org.apereo.cas.authentication.principal.resolvers.EchoingPrincipalResolver@6976f5ad[]]]] resolved [scott] from [scott]>
2017-12-13 11:27:48,989 DEBUG [org.apereo.cas.authentication.AbstractAuthenticationManager] - <Final principal resolved for this authentication event is [scott]>
2017-12-13 11:27:48,990 DEBUG [org.apereo.cas.authentication.policy.RequiredHandlerAuthenticationPolicy] - <Examining authentication successes for authentication handler [CustomFileAuthenticationHandler]>
2017-12-13 11:27:48,990 WARN [org.apereo.cas.authentication.policy.RequiredHandlerAuthenticationPolicy] - <Required authentication handler [CustomFileAuthenticationHandler] is not present in the list of recorded successful authentications>
2017-12-13 11:27:48,991 WARN [org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <Authentication has failed. Credentials may be incorrect or CAS cannot find authentication handler that supports [scott] of type [UsernamePasswordCredential], which suggests a configuration problem.>
2017-12-13 11:27:48,992 DEBUG [org.apereo.cas.authentication.PolicyBasedAuthenticationManager] - <Executing authentication policy [RequiredHandlerAuthenticationPolicy]>
2017-12-13 11:27:48,993 DEBUG [org.apereo.cas.authentication.policy.RequiredHandlerAuthenticationPolicy] - <Examining authentication successes for authentication handler [CustomFileAuthenticationHandler]>
2017-12-13 11:27:48,993 WARN [org.apereo.cas.authentication.policy.RequiredHandlerAuthenticationPolicy] - <Required authentication handler [CustomFileAuthenticationHandler] is not present in the list of recorded successful authentications>

2017-12-13 11:27:48,997 INFO [org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO
: scott
WHAT
: Supplied credentials: [scott]
ACTION
: AUTHENTICATION_FAILED
APPLICATION
: CAS
WHEN
: Wed Dec 13 11:27:48 EET 2017
CLIENT IP ADDRESS
: 10.1.10.105
SERVER IP ADDRESS
: 10.1.15.57
=============================================================


>
2017-12-13 11:27:49,011 ERROR [org.apereo.cas.web.flow.AuthenticationExceptionHandlerAction] - <Unable to translate handler errors of the authentication exception [org.apereo.cas.authentication.AuthenticationException: 0 errors, 1 successes]Returning [UNKNOWN]>




I'd highlighted the lines show that the custom handler is not registered!!

Man H

unread,
Dec 13, 2017, 10:11:09 AM12/13/17
to cas-...@apereo.org
this is what you should see when your handler is registered:

2017-12-13 11:51:49,296 INFO [org.apereo.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: audit:unknown
WHAT: [event=success,timestamp=Wed Dec 13 11:51:49 ART 2017,source=RankedAuthenticationProviderWebflowEventResolver]
ACTION: AUTHENTICATION_EVENT_TRIGGERED
APPLICATION: CAS
WHEN: Wed Dec 13 11:51:49 ART 2017
CLIENT IP ADDRESS: 127.0.0.1
SERVER IP ADDRESS: 127.0.0.1
=============================================================

>
2017-12-13 11:51:49,577 DEBUG [org.apereo.cas.authentication.principal.WebApplicationServiceFactory] - <No service is specified in the request. Skipping service creation>
2017-12-13 11:51:50,684 WARN [org.apereo.cas.web.view.CasReloadableMessageBundle] - <The code [screen.capslock.on] cannot be found in the default language bundle and will be used as the message itself.>
2017-12-13 11:51:59,115 DEBUG [org.apereo.cas.authentication.principal.WebApplicationServiceFactory] - <No service is specified in the request. Skipping service creation>
2017-12-13 11:51:59,133 DEBUG [org.apereo.cas.authentication.adaptive.DefaultAdaptiveAuthenticationPolicy] - <Located client IP address as [127.0.0.1]>
2017-12-13 11:51:59,134 DEBUG [org.apereo.cas.authentication.adaptive.DefaultAdaptiveAuthenticationPolicy] - <User agent [Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0] is authorized to proceed>
2017-12-13 11:51:59,134 DEBUG [org.apereo.cas.authentication.adaptive.DefaultAdaptiveAuthenticationPolicy] - <Adaptive authentication policy has authorized client [127.0.0.1] to proceed.>
2017-12-13 11:51:59,154 DEBUG [org.apereo.cas.authentication.RegisteredServiceAuthenticationHandlerResolver] - <Authentication handlers used for this transaction are [HttpBasedServiceCredentialsAuthenticationHandlerMyAuthenticationHandler]>



Could you please attach bootstrap.properties and cas.properties. Make sure your properties are read, if you deploy with build.sh script those are overridden.


--
- 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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/c292b2ac-7175-4788-b161-9db85e9c98f3%40apereo.org.

Man H

unread,
Dec 13, 2017, 10:22:09 AM12/13/17
to cas-...@apereo.org
Also please attach your overlay .pom. Note that this is a required dependency:

        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-webapp${app.server}</artifactId>
            <type>war</type>
            <scope>runtime</scope>
        </dependency>


2017-12-13 6:24 GMT-03:00 noumann.f <noum...@gmail.com>:

--
- 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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/c292b2ac-7175-4788-b161-9db85e9c98f3%40apereo.org.

noumann.f

unread,
Dec 13, 2017, 2:41:27 PM12/13/17
to CAS Community
For the pom.xml, I'm using exactly the one in the cas-overlay-template but adding the generic dependency like this:

pom.xml
...
<dependencies>

       
<dependency>
           
<groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-webapp${app.server}</
artifactId>

           
<version>${cas.version}</version>

           
<type>war</type>
            <scope>runtime</
scope>
       
<
/dependency>
        <dependency>

          <groupId>org.apereo.cas</
groupId>
         
<artifactId>cas-server-support-generic</artifactId>
          <version>${cas.version}</
version>
       
</dependency>
    </
dependencies>
...



The cas.properties:
cas.server.name: https://localhost:8443
cas
.server.prefix: https://localhost:8443/cas

cas
.adminPagesSecurity.ip=127\.0\.0\.1

logging
.config: file:/etc/cas/config/log4j2.xml
cas
.tgc.encryptionKey=Mxw ... aR4

cas
.tgc.signingKey=DJM ... -iQ
cas
.tgc.cipherEnabled=true

cas
.webflow.signing.key=QzD ... -LQ

cas
.webflow.signing.keySize=512
cas
.webflow.encryption.keySize=16
cas
.webflow.encryption.key=GuE ... TJy
cas
.webflow.alg=AES

cas
.authn.accept.users=
logging
.level.org.apereo=DEBUG


#File Authentication
##################################################
cas
.authn.file.separator=::
cas
.authn.file.filename=file:///etc/cas/usersfile
cas
.authn.file.name=
usersfile


cas
.authn.policy.requiredHandlerAuthenticationPolicyEnabled=true
cas
.authn.policy.req.tryAll=false
cas
.authn.policy.req.handlerName=CustomFileAuthenticationHandler
cas
.authn.policy.req.enabled=true


Where can I find the bootstrap.properties file?

Regards,
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

Man H

unread,
Dec 13, 2017, 5:47:29 PM12/13/17
to cas-...@apereo.org
Hi

Can you comment out cas.authn.accept.users= in cas properties and see if at least you can authenticate with casuser?


2017-12-13 6:24 GMT-03:00 noumann.f <noum...@gmail.com>:

--
- 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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/c292b2ac-7175-4788-b161-9db85e9c98f3%40apereo.org.

noumann.f

unread,
Dec 14, 2017, 2:45:13 AM12/14/17
to CAS Community
Commenting out only `cas.authn.accept.users=` didn't help, BUT commenting the policy entries either made it work and let me authenticate as (casuser, Mellon).
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

Man H

unread,
Dec 14, 2017, 8:51:20 AM12/14/17
to cas-...@apereo.org
Ok,

using this a starting point try to debug your handler.

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/3663190f-ebd2-4c4c-a3be-29187617927c%40apereo.org.

noumann.f

unread,
Dec 20, 2017, 9:22:01 AM12/20/17
to CAS Community
And that's what happened,

setting up a fresh development env. and following the instructions inhere: https://apereo.github.io/cas/5.1.x/installation/Configuring-Custom-Authentication.html enabled me to create a custom handler that accepts users whom username is similar to their password as a simple example.

Then, imitating the JDBC query authentication handler I could modified my handler to connect and authenticate against a MySql database.

What is annoying me is that I couldn't create my own custom properties in the `cas.properties` and I'm depending on the `cas.authn.jdbc.query[0].xxx` properties. For the current time, any needed properties are hard-coded in the handler class!!
Is there any easy way to do this without hacking a lot of source code?!

Thanks a lot for your help,

Best regards,

Man H

unread,
Dec 20, 2017, 1:50:57 PM12/20/17
to cas-...@apereo.org
Hi

glad to hear your progress. 

To load your properties you could have a look on how they are loaded for cas in src org.apereo.cas.configuration.CasConfigurationProperties where all properties are loaded.
Important thing is this:

@ConfigurationProperties("cas")
public class CasConfigurationProperties


Regards



To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/944b96d0-d112-460d-b9a2-74899d8fe9ea%40apereo.org.

noumann.f

unread,
Dec 21, 2017, 7:23:03 AM12/21/17
to CAS Community
Thanks,

Yes indeed, it's all about `CasConfigurationProperties` class, but I was wondering if there is any way to do this without needing to override this class in my project.

Anyway, while my handler is alive without this feature I can postpone this.

Regards,


On Wednesday, December 20, 2017 at 8:50:57 PM UTC+2, Manfredo Hopp wrote:
Hi


WHO
: audit:</

Robert Oschwald

unread,
Dec 21, 2017, 7:28:12 AM12/21/17
to cas-...@apereo.org
you can introduce your own config keys in cas.properties and define your own Config bean.

Access the properties with @Value annotation in the config bean like so:
@Configuration(myCustomApplicationConfiguration")
@EnableConfigurationProperties(CasConfigurationProperties.class)
@AutoConfigureAfter(CasCoreTicketsConfiguration.class)
public class MyCustomApplicationConfiguration {
  @Value(${my.custom.property}")
public String customProp
    ...
}
 

--
- 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.

yashwanth chowdary

unread,
Mar 21, 2018, 4:58:14 AM3/21/18
to CAS Community
I am using cas 5.3.0 and i am trying to persist tickets using jpa, running into issues can you give you share your pom.xml and properties file that actually worked for you.

Man H

unread,
Mar 21, 2018, 7:29:30 AM3/21/18
to cas-...@apereo.org
If you meant ticket registry use
cas.ticket.registry.jpa.healthQuery

If service registry

as.serviceRegistry.jpa.healthQuery
--
- 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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/BN6PR05MB3634493DE6A1C5C479F9441286370%40BN6PR05MB3634.namprd05.prod.outlook.com.

yashwanth chowdary

unread,
Mar 21, 2018, 9:08:04 AM3/21/18
to CAS Community
For Jpa ticket registry these are the properties i was using:

cas.ticket.registry.jpa.dialect=org.hibernate.dialect.Oracle10gDialect
cas.ticket.registry.jpa.url=XXXXXXXX
cas.ticket.registry.jpa.driverClass=oracle.jdbc.driver.OracleDriver
cas.ticket.registry.jpa.user=xxxxxx
cas.ticket.registry.jpa.password=xxxxx
cas.ticket.registry.jpa.ddlAuto=validate
cas.ticket.registry.jpa.defaultSchema=xxxxx
cas.ticket.registry.jpa.batchSize=1
cas.ticket.registry.jpa.healthQuery=SELECT 1 FROM DUAL

My schema tables locks,tgt,rs_attributes,serviceticket,registeredticketimpl are structured in such a way that they support cas3.5 version.Is there any change in structure of tables

Dependencies:
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jpa-ticket-registry</artifactId>
<version>5.3.0-RC2</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.1.0</version>
</dependency>

And when i try to run the cas application, unsatisfied dependency exception,unable to create hibernate session factory,.. You can observe the logs in below attached files
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
log2.PNG
log1.PNG

rachepalli yashwanth kumar chowdary

unread,
Mar 21, 2018, 11:39:31 AM3/21/18
to cas-...@apereo.org
For Jpa ticket registry these are the properties i was using:

cas.ticket.registry.jpa.dialect=org.hibernate.dialect.Oracle10gDialect
cas.ticket.registry.jpa.url=XXXXXXXX
cas.ticket.registry.jpa.driverClass=oracle.jdbc.driver.OracleDriver
cas.ticket.registry.jpa.user=xxxxxx
cas.ticket.registry.jpa.password=xxxxx
cas.ticket.registry.jpa.ddlAuto=validate
cas.ticket.registry.jpa.defaultSchema=xxxxx
cas.ticket.registry.jpa.batchSize=1
cas.ticket.registry.jpa.healthQuery=SELECT 1 FROM DUAL

My schema tables locks,tgt,rs_attributes,serviceticket,registeredticketimpl are structured in such a way that they support cas3.5 version.Is there any change in structure of tables

Dependencies:
<dependency>
<groupId>org.apereo.cas</groupId>
<artifactId>cas-server-support-jpa-ticket-registry</artifactId>
<version>5.3.0-RC2</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.1.0</version>
</dependency>
And when i try to run the cas application, unsatisfied dependency exception,unable to create hibernate session factory,.. You can observe the logs in below attached files


To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.

--
- 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+unsubscribe@apereo.org.
log1.PNG
log2.PNG
Reply all
Reply to author
Forward
0 new messages