authentication - AbstractJdbcUsernamePasswordAuthenticationHandler

34 views
Skip to first unread message

iris mc

unread,
Apr 19, 2016, 8:16:50 PM4/19/16
to CAS Community

Good afternoon
, I have a question,
I created a class that extends the AbstractJdbcUsernamePasswordAuthenticationHandler class, I will add my logic of authentication, but when compiling get an error, does not recognize the import of the AbstractJdbcUsernamePasswordAuthenticationHandler class, but it is in the pom.xml. The error is for
license issues? but I added my data in the licence file

   Copyright [2016] [mi nombre]
..
..

My clase

import org.jasig.cas.adaptors.jdbc.AbstractJdbcUsernamePasswordAuthenticationHandler;  //<----
does not recognize
//...other imports

public class ValidatorCas extends AbstractJdbcUsernamePasswordAuthenticationHandler {


    public final HandlerResult authenticateUsernamePasswordInternal( UsernamePasswordCredential credential)
            throws GeneralSecurityException, PreventedException {

        final String username = credential.getUsername();
        System.out.println("implementar la logica para autenticación con usuario de tabla y usuarios de base de datos(esquema)");
        try {
        } catch (final IncorrectResultSizeDataAccessException e) {
            if (e.getActualSize() == 0) {
                throw new AccountNotFoundException(username + " not found with SQL query");
            } else {
                throw new FailedLoginException("Multiple records found for " + username);
            }
        } catch (final DataAccessException e) {
            throw new PreventedException("SQL exception while executing query for " + username, e);
        }
         return createHandlerResult(credentials, new SimplePrincipal(username), null);
    }

}

pom.xml
=======
        <dependency>
           <groupId>org.jasig.cas</groupId>
           <artifactId>cas-server-support-jdbc</artifactId>
           <version>4.0.1</version>
           <type>jar</type>
           <scope>runtime</scope>
    </dependency>

thanks



iris mc

unread,
Apr 19, 2016, 8:17:51 PM4/19/16
to CAS Community


Cas server 4.0.1
Reply all
Reply to author
Forward
0 new messages