Dennis von Eich Dennis von Eich - 1 month ago 22
reST (reStructuredText) Question

CAS: Service Ticket/CAS-Server reply is empty

I use the RESTful API and when I take the TGT to request an ST at

https://www.mysite.de/cas/v1/tickets/" + tgt
my CAS server throws this:

2016-10-12 18:07:39,168 DEBUG [org.springframework.webflow.mvc.servlet.FlowHandlerMapping] - <No flow mapping found for request with URI '/cas/v1/tickets/TGT-**********************************************6rXJ4WKxmo-cas01.example.org'>
2016-10-12 18:07:39,168 DEBUG [org.springframework.webflow.mvc.servlet.FlowHandlerMapping] - <No flow mapping found for request with URI '/cas/v1/tickets/TGT-**********************************************6rXJ4WKxmo-cas01.example.org'>
2016-10-12 18:07:39,168 WARN [org.springframework.web.servlet.PageNotFound] - <No mapping found for HTTP request with URI [/cas/v1/tickets/TGT-**********************************************6rXJ4WKxmo-cas01.example.org] in DispatcherServlet with name 'cas'>


When I print out my response in my console I just get:

Service Ticket: 0♠


The
0♠
is what is in the response that I get by doing this:

QByteArray replyData = reply->readAll();
QString serviceTicket = QString::fromAscii(replyData.data());
fprintf(stderr, "Service Ticket: %s\n", QString::fromAscii(replyData.data()));


I guess I have a misunderstanding here. I just suppose that the reply is a
QString
or at least will be converted the right way. Is it possible that the reply has a format that simply cannot be converted like that? If yes, what do I need to do?

If this is not the reason and the reply is simply an emptry reply or something, the above mentioned
DEBUG
info might indicate what my problem is.

Do I maybe have to make any other changes to the
web.xml
in order to get REST working here? Everything I did was just from this source.

EDIT: Seems like a bug from CAS 4.2.6. I downgraded to 4.2.5 and now I get a NullPointerException on teh CAS Server when i send the encrypted TGT over the RESTful APi

Answer

It turned out that this is a bug from CAS 4.2.6. Go to WEB-INF\lib\cas-server-webapp-support-4.2.6.jar\META-INF\spring\web-ctx-config.xml in your war and change this:

<bean id="urlPathHelperWeb" class="org.springframework.web.util.UrlPathHelper"
          p:alwaysUseFullPath="true" />

to this:

<bean id="urlPathHelperWeb" class="org.springframework.web.util.UrlPathHelper"
          p:alwaysUseFullPath="false" />
Comments