Custom Authentication Handler

427 views
Skip to first unread message

Ramakrishna G

unread,
Jan 31, 2018, 12:36:13 AM1/31/18
to cas-...@apereo.org
Hi Team,

I need to write a for CAS which takes userId, password and pancard number. All 3 parameters will be sent to custom server(My other server, Not in CAS) and validated and response is returned back.

How can I achieve this is CAS overlay?

Thanks
Ramakrishna G

Ramakrishna G

unread,
Jan 31, 2018, 12:47:03 AM1/31/18
to cas-...@apereo.org
Ignore previous mail.

need to write a for Custom Authentication Handler for CAS which takes userId, password and pancard number. All 3 parameters will be sent to custom server(My other server, Not in CAS) and validated and response is returned back.

Ramakrishna G

unread,
Jan 31, 2018, 4:10:40 AM1/31/18
to cas-...@apereo.org
I tried following this https://apereo.github.io/2017/02/02/cas51-authn-handlers/ for Custom Authentication Handler but MyAuthenticationHandler is never called or registered. 

Oschwald Robert

unread,
Jan 31, 2018, 4:42:24 AM1/31/18
to cas-...@apereo.org
Have you registered your handler config bean in spring.factories?

depending on your CAS Server version.





--
- 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/CAGST5P-5ev_yAxFhJT7deCipsM%3DK9ii16tT1Fdtt7KfLu8qKBQ%40mail.gmail.com.

Ramakrishna G

unread,
Jan 31, 2018, 6:27:27 AM1/31/18
to cas-...@apereo.org
My cas-overlay version is 5.2.1

On Wed, Jan 31, 2018 at 3:45 PM, Ramakrishna G <r...@tts.in> wrote:
Hi Robert,

I am using cas-overlay. I have the below 2 files under src/main/resource folder and package name com.example.cas

I have also spring.factories file inside src/main/resource/META-INF. 

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\

com.example.cas.MyAuthenticationEventExecutionPlanConfiguration



What am I missing? When I enter my username and password this handler is never called.


Ramakrishna G

unread,
Jan 31, 2018, 6:27:27 AM1/31/18
to cas-...@apereo.org
Hi Robert,

I am using cas-overlay. I have the below 2 files under src/main/resource folder and package name com.example.cas

I have also spring.factories file inside src/main/resource/META-INF. 

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\

com.example.cas.MyAuthenticationEventExecutionPlanConfiguration



What am I missing? When I enter my username and password this handler is never called.

On Wed, Jan 31, 2018 at 3:12 PM, Oschwald Robert <roberto...@gmail.com> wrote:
Have you registered your handler config bean in spring.factories?

depending on your CAS Server version.



Am 31.01.2018 um 10:10 schrieb Ramakrishna G <r...@tts.in>:

I tried following this https://apereo.github.io/2017/02/02/cas51-authn-handlers/ for Custom Authentication Handler but MyAuthenticationHandler is never called or registered. 

On Wed, Jan 31, 2018 at 11:16 AM, Ramakrishna G <r...@tts.in> wrote:
Ignore previous mail.

need to write a for Custom Authentication Handler for CAS which takes userId, password and pancard number. All 3 parameters will be sent to custom server(My other server, Not in CAS) and validated and response is returned back.

How can I achieve this is CAS overlay?


Thanks
Ramakrishna G



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

--
- 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/57276E93-FBD8-4F9D-B0FE-3E48794EF6B9%40gmail.com.

MyAuthenticationEventExecutionPlanConfiguration.java
MyAuthenticationHandler.java

Ray Bon

unread,
Jan 31, 2018, 11:47:53 AM1/31/18
to cas-...@apereo.org
Ramakrishna,

The path should be src/main/resources/META-INF (resources with an 's').
You could also put some logging in your Configuration file to make sure it is being called and the properties are being set correctly.

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

Ramakrishna G

unread,
Jan 31, 2018, 12:30:12 PM1/31/18
to cas-...@apereo.org
It is resources only. My typo mistake.

No logs as well related to this. Can you send me  a sample or GitHub project link which works with custom authentication handler?

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+u...@apereo.org.
-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

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

Ray Bon

unread,
Jan 31, 2018, 2:58:16 PM1/31/18
to cas-...@apereo.org
Try these for web flow and configuration:
<AsyncLogger name="org.apereo.cas.web.flow" level="debug" includeLocation="true"/>
<AsyncLogger name="org.apereo.cas.config" level="debug" includeLocation="true"/>

You can also put logging into your file MyAuthenticationEventExecutionPlanConfiguration.

Ray

Ramakrishna G

unread,
Feb 2, 2018, 8:30:11 AM2/2/18
to cas-...@apereo.org
I created src/main/java foder inside cas-overlay project.

I used 2 java file as explained in https://apereo.github.io/cas/5.2.x/installation/Configuring-Custom-Authentication.html. I have also registered using spring.factories.

When i run mvn clean package from terminal it says

[INFO] Building cas-overlay 1.0

[INFO] ------------------------------------------------------------------------

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 1.873 s

[INFO] Finished at: 2018-02-02T18:57:52+05:30

[INFO] Final Memory: 29M/309M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal on project cas-overlay: Could not resolve dependencies for project org.apereo.cas:cas-overlay:war:1.0: Failure to find org.apereo.cas:cas-server-webapp:jar:5.2.1 in http://oss.sonatype.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-releases has elapsed or updates are forced -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project cas-overlay: Could not resolve dependencies for project org.apereo.cas:cas-overlay:war:1.0: Failure to find org.apereo.cas:cas-server-webapp:jar:5.2.1 in http://oss.sonatype.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-releases has elapsed or updates are forced

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:249)

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:145)

    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:246)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:200)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)

    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)

    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)

    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)

    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)

    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)

    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke (Method.java:498)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)

    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)

    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project org.apereo.cas:cas-overlay:war:1.0: Failure to find org.apereo.cas:cas-server-webapp:jar:5.2.1 in http://oss.sonatype.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-releases has elapsed or updates are forced

    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:209)

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:223)

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:145)

    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:246)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:200)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)

    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)

    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)

    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)

    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)

    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)

    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke (Method.java:498)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)

    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)

    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Failure to find org.apereo.cas:cas-server-webapp:jar:5.2.1 in http://oss.sonatype.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-releases has elapsed or updates are forced

    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:355)

    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:202)

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:223)

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:145)

    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:246)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:200)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)

    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)

    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)

    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)

    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)

    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)

    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke (Method.java:498)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)

    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)

    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to find org.apereo.cas:cas-server-webapp:jar:5.2.1 in http://oss.sonatype.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-releases has elapsed or updates are forced

    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:422)

    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:224)

    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies (DefaultRepositorySystem.java:338)

    at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve (DefaultProjectDependenciesResolver.java:202)

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies (LifecycleDependencyResolver.java:223)

    at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies (LifecycleDependencyResolver.java:145)

    at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved (MojoExecutor.java:246)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:200)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)

    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)

    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)

    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)

    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)

    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)

    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)

    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)

    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke (Method.java:498)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)

    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)

    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)

    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Failure to find org.apereo.cas:cas-server-webapp:jar:5.2.1 in http://oss.sonatype.org/content/repositories/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of sonatype-releases has elapsed or updates are forced



How do i fix this issue? 

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

--
- 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.
MyAuthenticationEventExecutionPlanConfiguration.java
MyAuthenticationHandler.java
pom.xml
application.properties
Reply all
Reply to author
Forward
0 new messages