rogerrut    2004/11/16 11:03:35

  Added:       jetspeed-api/src/java/org/apache/jetspeed/sso
                        SSOContext.java SSOException.java SSOProvider.java
  Log:
  Single Sign On SSO Framework
  The current version of SSO relies on the Jetspeed security model (storage of 
credentials/Principals) but for future release it can be decoupled from 
Jetspeed.
  Portlets (IFrame, perl, PHP) will be enhanced (Preference setting) so that 
they can enable SSO functionality.
  
  Revision  Changes    Path
  1.1                  
jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/sso/SSOContext.java
  
  Index: SSOContext.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
  
  package org.apache.jetspeed.sso;
  
  /**
  * <p>Utility component to handle SSO requests</p>
  * 
  * @author <a href="mailto:[EMAIL PROTECTED]">Roger Ruttimann</a>
  */
  
  public interface SSOContext {
  
        // Getters only. The interface shouldn't allow any changes
        public long             getUserID();
        public String   getUserName();
        public String   getPassword();
  }
  
  
  
  1.1                  
jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/sso/SSOException.java
  
  Index: SSOException.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
  
  package org.apache.jetspeed.sso;
  
  import org.apache.jetspeed.exception.JetspeedException;
  
  /**
  * <p>Exception throwns by members of the sso service.</p>
  *
  * @author <a href="mailto:rogerrut    @apache.org">Roger Ruttimann</a>
  */
  
  public class SSOException extends JetspeedException {
  
     /** <p>Adding the credentials to the request failed.</p> */
     public static final String BASIC_AUTHENTICATION_ADD_FAILED = "Adding the 
credentials to the request failed.";
   
     /** <p>The site has no Single Sign On credentails attached.</p> */
     public static final String NO_CREDENTIALS_FOR_SITE = "The site has no 
Single Sign On credentails attached.";
  
     /** <p>Adding the credentials for site failed.</p> */
     public static final String FAILED_ADDING_CREDENTIALS_FOR_SITE = "Adding 
the credential for site failed.";
     
     /** <p>Removing the credential for site failed.</p> */
     public static final String FAILED_REMOVING_CREDENTIALS_FOR_SITE = 
"Removing the credential for site failed.";
     
     /** <p>Failed to store site info in database.</p> */
     public static final String FAILED_STORING_SITE_INFO_IN_DB = "Failed to 
store site info in database.";
     
    
     /**
      * <p>Default Constructor.</p>
      */
     public SSOException()
     {
         super();
     }
  
     /**
      * <p>Constructor with exception message.</p>
      * @param message The exception message.
      */
     public SSOException(String message)
     {
         super(message);
     }
  
     /**
      * <p>Constructor with nested exception.</p>
      * @param nested Nested exception.
      */
     public SSOException(Throwable nested)
     {
         super(nested);
     }
  
     /**
      * <p>Constructor with exception message and nested exception.</p>
      * @param msg The exception message.
      * @param nested Nested exception.
      */
     public SSOException(String msg, Throwable nested)
     {
         super(msg, nested);
     }
  
  }
  
  
  
  
  1.1                  
jakarta-jetspeed-2/jetspeed-api/src/java/org/apache/jetspeed/sso/SSOProvider.java
  
  Index: SSOProvider.java
  ===================================================================
  /* Copyright 2004 Apache Software Foundation
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
  package org.apache.jetspeed.sso;
  
  import javax.security.auth.Subject;
  import javax.servlet.http.HttpServletRequest;
  
  /**
  * <p>Utility component to handle SSO requests</p>
  * 
  * @author <a href="mailto:[EMAIL PROTECTED]">Roger Ruttimann</a>
  */
  public interface SSOProvider
  {   
        /**
         * Init
         * Called from the Spring Framework to initialize SSO Provider component
         * @throws Exception
         */
     void init() throws Exception;
     
     /**
      * Public API's for SSO functinality
      * @return
      */
        boolean                 hasSSOCredentials(Subject subject, String site);
        void                                    
addBasicAuthenticationForSite(HttpServletRequest request, Subject subject, 
String site) throws SSOException;
        SSOContext              getCredentials(Subject subject, String site)  
throws SSOException;;
        void                            addCredentialsForSite(Subject subject, 
String site, String pwd)  throws SSOException; 
        void                            removeCredentialsForSite(Subject 
subject, String site)  throws SSOException; 
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to