Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
This project provides a simple implementation of CAS authentication through RequestFactory
Java
Branch: master
Failed to load latest commit information.
src/main
.gitignore Added .gitignore
README.md Fixed readme errors
pom.xml Added resources

README.md

Usage

Server

Add the CAS filters in you web.xml except the AuthenticationFilter.

<filter>
  <filter-name>CAS Validation Filter</filter-name>
  <filter-class>org.jasig.cas.client.validation.Cas10TicketValidationFilter</filter-class>
  <init-param>
    <param-name>casServerUrlPrefix</param-name>
    <param-value>https://cas.company.com</param-value>
  </init-param>
  <init-param>
    <param-name>serverName</param-name>
    <param-value>http://www.company.com</param-value>
  </init-param>
</filter>
<filter>
  <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
  <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
</filter>
<filter>
  <filter-name>CAS Assertion Thread Local Filter</filter-name>
  <filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class>
</filter>
<filter>
  <filter-name>GWT RequestFactory CAS Auth Filter</filter-name>
  <filter-class>fr.univpau.gwt.cas.server.CasFilter</filter-class>
  <init-param>
    <param-name>serverName</param-name>
    <param-value>https://www.company.com/MyGwtApp/MyGwtApp.html</param-value>
  </init-param>
  <init-param>
    <param-name>casServerLoginUrl</param-name>
    <param-value>https://cas.company.com/login</param-value>
  </init-param>
</filter>

<filter-mapping>
   <filter-name>CAS Validation Filter</filter-name>
   <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>CAS Assertion Thread Local Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>GWT RequestFactory CAS Auth Filter</filter-name>
    <url-pattern>/gwtRequest</url-pattern>
</filter-mapping>

Client

Add <inherits name="fr.univpau.gwt.cas.Cas"/> to your GWT XML module descriptor. Extends your own RequestFactory interface with MakeCasRequest :

public interface MyRequestFactory extends RequestFactory, MakeCasRequest {
}

Use CasRequestTransport as RequestTransport when you initialize your RF instance :

MyRequestFactory rf = GWT.create(MyRequestFactory.class);
rf.initialize(bus, new CasRequestTransport());

Then you can use it as a new RequestFactory request :

CasRequest request = rf.casRequest();
request.getCurrentUser().to(new Receiver() {
    @Override
    public void onSuccess(CasUserProxy user) {
        Window.alert("user is " + user.getLogin());
    }
}).
request.fire();

You can also use the simple but embedded widget LoginWidget

Maven repositories

Latest release (for GWT 2.4):

Something went wrong with that request. Please try again.