Changeset 28611

Show
Ignore:
Timestamp:
01/09/08 18:32:54 (9 months ago)
Author:
tdelprat
Message:

make startURL dynamic

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nuxeo-addons/nuxeo-platform-login-cas2/trunk/Sample/Sample-CAS2-descriptor-bundle.xml

    r20306 r28611  
    2727    <authenticationChain> 
    2828      <plugins> 
     29        <plugin>BASIC_AUTH</plugin> 
    2930        <plugin>CAS2_AUTH</plugin> 
    30         <plugin>BASIC_AUTH</plugin> 
    3131      </plugins> 
    3232    </authenticationChain> 
  • nuxeo-addons/nuxeo-platform-login-cas2/trunk/pom.xml

    r27915 r28611  
    4242  </dependencies> 
    4343 
     44  <build> 
     45    <plugins> 
     46      <plugin> 
     47        <groupId>org.apache.maven.plugins</groupId> 
     48        <artifactId>maven-jar-plugin</artifactId> 
     49        <configuration> 
     50          <archive> 
     51            <manifestFile> 
     52              src/main/resources/META-INF/MANIFEST.MF 
     53            </manifestFile> 
     54          </archive> 
     55        </configuration> 
     56      </plugin> 
     57    </plugins> 
     58  </build> 
     59 
    4460</project> 
  • nuxeo-addons/nuxeo-platform-login-cas2/trunk/src/main/java/org/nuxeo/ecm/platform/ui/web/auth/cas2/Cas2Authenticator.java

    r25652 r28611  
    3232import org.nuxeo.ecm.platform.ui.web.auth.interfaces.NuxeoAuthenticationPlugin; 
    3333import org.nuxeo.ecm.platform.ui.web.auth.interfaces.NuxeoAuthenticationPluginLogoutExtension; 
     34import org.nuxeo.ecm.platform.ui.web.util.BaseURL; 
    3435import org.xml.sax.SAXException; 
    3536import edu.yale.its.tp.cas.client.ServiceTicketValidator; 
     
    4849    protected final static String CAS_SERVER_HEADER_KEY = "CasServer"; 
    4950    protected final static String CAS_SERVER_PATTERN_KEY = "$CASSERVER"; 
     51    protected final static String NUXEO_SERVER_PATTERN_KEY = "$NUXEO"; 
    5052    protected final static String LOGIN_ACTION = "Login"; 
    5153    protected final static String LOGOUT_ACTION = "Logout"; 
     
    9799        try { 
    98100            //httpResponse.sendRedirect(serviceLoginURL + "?" + serviceKey + "=" + appURL); 
    99             httpResponse.sendRedirect( getServiceURL(httpRequest, LOGIN_ACTION) + "?" + serviceKey + "=" + appURL); 
     101            httpResponse.sendRedirect( getServiceURL(httpRequest, LOGIN_ACTION) + "?" + serviceKey + "=" + getAppURL(httpRequest)); 
    100102        } catch (IOException e) { 
    101103            log.error("Unable to redirect to CAS login screen:" + e.getMessage()); 
     
    104106        } 
    105107        return true; 
     108    } 
     109 
     110    private String getAppURL(HttpServletRequest httpRequest) 
     111    { 
     112        if ((appURL==null) || (appURL.equals(""))) 
     113                { 
     114                appURL=NUXEO_SERVER_PATTERN_KEY; 
     115                } 
     116        if (appURL.contains(NUXEO_SERVER_PATTERN_KEY)) 
     117        { 
     118                String nxurl = BaseURL.getBaseURL(httpRequest); 
     119                return appURL.replace(NUXEO_SERVER_PATTERN_KEY, nxurl); 
     120        } 
     121        else 
     122                return appURL; 
    106123    } 
    107124 
  • nuxeo-addons/nuxeo-platform-login-cas2/trunk/src/main/resources/OSGI-INF/CAS2-authenticator-contrib.xml

    r22052 r28611  
    22 
    33<component name="org.nuxeo.ecm.platform.login.Cas2SSO"> 
     4   <documentation><pre> 
     5                CAS2 Authentication Plugin 
     6                Parameters include : 
     7                 - ticketKey : name of the ticket parameter in the URL 
     8                 - appURL : url used to connect to nuxeo when CAS auth is done 
     9                   ( can be $NUXEO to let Nuxeo compute the URL) 
     10                 - serviceLoginURL : CAS url for login form 
     11                   ( can use $CASSERVER to let nuxeo define url according to CasServer header) 
     12                 - serviceValidateURL : CAS url for ticket validation 
     13                   ( can use $CASSERVER to let nuxeo define url according to CasServer header) 
     14                 - serviceKey : name of the service parameter in the URL</pre> 
     15   </documentation> 
    416   <extension 
    517      target="org.nuxeo.ecm.platform.ui.web.auth.service.PluggableAuthenticationService"