CAS WAR Overlay - REST APIs added in custom java class not detecting

192 views
Skip to first unread message

Nishant Singh

unread,
Jun 19, 2020, 7:52:12 AM6/19/20
to CAS Community
I am working on customising CAR WAR Overlay with version 6.1.x and add some new functionalities in the form of REST APIs. Now CAS says that in order to add a custom java class we need to do the following:

"In order to include custom Java source, it should be included under a src/main/java directory in the overlay project source tree."

So i included my java class which is a REST Controller at this location: src/main/java/com/example/rest/RestController.class

However, when I run my overlay project in intellij using the command ./gradlew run and try the APIs in Postman then i get 404. Am i missing something here?

I want to do the customisation in overlay so i dont face problem whenever i upgrade cas version. This is the link where CAS explains about the ability to customise is below:

Ray Bon

unread,
Jun 19, 2020, 12:21:39 PM6/19/20
to cas-...@apereo.org
Nishant,

You will also have to add, to cas overlay, the configuration to let it know how to handle your endpoint.
Look in to how cas does its REST login, https://apereo.github.io/cas/development/protocol/REST-Protocol.html. This will require digging in to the cas source, https://github.com/apereo/cas.

Ray

On Fri, 2020-06-19 at 04:52 -0700, Nishant Singh wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

Nishant Singh

unread,
Jun 30, 2020, 5:15:37 AM6/30/20
to CAS Community
Hi Ray,

Thanks a lot for your reply. Your response worked for me. I looked into the architecture of CAS Support Rest module and understood that you have to register your new controller in CasRestConfiguration.java as a bean and injecting all the dependencies required by the controller class.

Now i am able to add my own classes in the CAS Overlay Project by configuring them and also customize  the existing classes of CAS too.


Nishant Singh
Reply all
Reply to author
Forward
0 new messages