Fórum

Portlet and CAS

Amedeo Falanga, modificado 13 Anos atrás.

Portlet and CAS

New Member Postagens: 15 Data de Entrada: 25/10/10 Postagens Recentes
Hello everyone,

I need to use CAS for some of my portlet in Liferay.
Configuring Liferay and my application with CAS separately everything works, but when I generate my portlet I have problem with ticket authentication (application can not authenticate).
I followed the instructions in the wiki JASIG, whose links below

https://wiki.jasig.org/display/CASC/CASandJSR-168

which says to use CASPortletWrapper, CASPortletUtils and ProxyTicketValidatorFactory classes, but does not explain how....

Can anyone give me some suggestions??

Thanks in advance

Cubillas
thumbnail
Apoorva Prakash, modificado 13 Anos atrás.

RE: Portlet and CAS

Liferay Master Postagens: 658 Data de Entrada: 15/06/10 Postagens Recentes
Amedeo Falanga:
Hello everyone,

I need to use CAS for some of my portlet in Liferay.
Configuring Liferay and my application with CAS separately everything works, but when I generate my portlet I have problem with ticket authentication (application can not authenticate).
I followed the instructions in the wiki JASIG, whose links below

https://wiki.jasig.org/display/CASC/CASandJSR-168

which says to use CASPortletWrapper, CASPortletUtils and ProxyTicketValidatorFactory classes, but does not explain how....

Can anyone give me some suggestions??

Thanks in advance

Cubillas


Hello Amedeo,
If I am getting your problem right, you have to implement ProxyTicketValidator for this purpose.. See the link...

Hope this will help...

Thanks and Regards...
Amedeo Falanga, modificado 13 Anos atrás.

RE: Portlet and CAS

New Member Postagens: 15 Data de Entrada: 25/10/10 Postagens Recentes
Thanks for reply,
but I'll try to explain my problem in more detail.
As described in the link https://wiki.jasig.org/display/CASC/CASandJSR-168, configuration of a portlet instance is as follows (portlet.xml):

    <portlet>
        <description>CASPortletWrapper</description>
        <portlet-name>CASPortletWrapper</portlet-name>
        <display-name>CASPortletWrapper</display-name>
        <portlet-class>edu.yale.its.tp.cas.client.portlet.CASPortletWrapper</portlet-class>
        <init-param>
            <name>edu.yale.its.tp.cas.client.portlet.WRAPPED_PORTLET_CLASS</name>
            <value>it.portlet.HelloWorld</value>
        </init-param>
        <init-param>
            <name>edu.yale.its.tp.cas.client.portlet.CasPortletUtilsPORTLET_SERVICE</name>
            <value>https://localhost:8443/HelloWorld/</value>
        </init-param>
        <init-param>
            <name>edu.yale.its.tp.cas.client.portlet.CasPortletUtils.PROXY_CALLBACK_URL</name>
            <value>https://localhost:8443/HelloWorld/CasProxyServlet</value>
        </init-param>
        <init-param>
            <name>edu.yale.its.tp.cas.client.portlet.CasPortletUtils.CAS_VALIDATE_URL</name>
            <value>https://localhost:8444/cas-web/proxyValidate</value>
        </init-param>
        <expiration-cache>0</expiration-cache>
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>VIEW</portlet-mode>
        </supports>
        <supported-locale>en</supported-locale>
        <portlet-info>
            <title>CASPortletWrapper</title>
            <keywords>CASPortletWrapper</keywords>
        </portlet-info>
    </portlet>
    <portlet>
        <description>PrimaPortlet</description>
        <portlet-name>HelloWorld</portlet-name>
        <display-name>HelloWorld</display-name>
        <portlet-class>it.portlet.HelloWorld</portlet-class>
        <expiration-cache>-1</expiration-cache>
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>VIEW</portlet-mode>
        </supports>
        <supported-locale>en</supported-locale>
        <portlet-info>
            <title>Hello World</title>
            <short-title>Hello World</short-title>
            <keywords>Hello world</keywords>
        </portlet-info>
    </portlet>

the web.xml is this:
  <servlet>
       <servlet-name>CasProxyServlet</servlet-name>
       <servlet-class>edu.yale.its.tp.cas.proxy.ProxyTicketReceptor</servlet-class>
        <init-param>
            <param-name>edu.yale.its.tp.cas.proxyUrl</param-name>
        <param-value>https://localhost:8444/cas-web/proxyValidate</param-value>
        </init-param>
     </servlet>
     
     <servlet-mapping>
       <servlet-name>CasProxyServlet</servlet-name>
       <url-pattern>/CasProxyServlet</url-pattern>
  </servlet-mapping>

When I try to get information [request.getPortletSession().getAttribute(CASFilter.CAS_FILTER_USER)], they are always NULL.
What is wrong?

Thanks
Amedeo