Hi Raheem,

I also encountered this issue on 5.2.x, not sure if this is still an issue 
on later CAS version, I suspect this issue is fixed on later version since 
it seems like a spring problem.

I used a very ugly method to suppress this message, basically I override 
the GET method and prevent the trace from giving out.

=====================================================================

*MyCompanyTicketGrantingTicketResourceGetMapper.java*

package my.company.cas.rest;
import org.springframework.http.HttpStatus;import 
org.springframework.http.ResponseEntity;import 
org.springframework.web.bind.annotation.GetMapping;import 
org.springframework.web.bind.annotation.RestController;

@RestController("MyCompanyTicketGrantingTicketResourceGetMapper")public class 
MyCompanyTicketGrantingTicketResourceGetMapper {

    /**
     * Reject Get Response, without exposing error trace to client
     *
     * @return ResponseEntity representing Method Not Allowed
     */
    @GetMapping("/v1/tickets")
    public ResponseEntity<String> rejectGetResponse() throws Exception {
        return new ResponseEntity<>("Method Not Allowed.", 
HttpStatus.METHOD_NOT_ALLOWED);
    }

}



=====================================================================
*MyCompanyRestConfiguraiton.java*

package my.company.cas.rest;
import org.apereo.cas.config.CasRestConfiguration;import 
org.apereo.cas.configuration.CasConfigurationProperties;import 
org.springframework.boot.context.properties.EnableConfigurationProperties;import
 org.springframework.context.annotation.Bean;import 
org.springframework.context.annotation.Configuration;import 
org.springframework.context.annotation.Import;



@Configuration("myCompanyCasRestConfiguration")
@Import(CasRestConfiguration.class)
@EnableConfigurationProperties(CasConfigurationProperties.class)public class 
MyCompanyCasRestConfiguration {
    
    @Bean
        public MyCompanyTicketGrantingTicketResourceGetMapper 
myCompanyTicketGrantingTicketResourceGetMapper() {
        return new MyCompanyTicketGrantingTicketResourceGetMapper();
    }
}



=====================================================================
And also an in the Auto Configuration on the *MyCompanyRestConfiguraiton 
*config 
in *spring.factories*.

=====================================================================

It works for me, see if it helps you as well.


Cheers!
- Andy

-- 
- 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/9fbecda0-bd9a-4423-8585-dc5233b0b5db%40apereo.org.

Reply via email to