001: /*
002: * JOSSO: Java Open Single Sign-On
003: *
004: * Copyright 2004-2008, Atricore, Inc.
005: *
006: * This is free software; you can redistribute it and/or modify it
007: * under the terms of the GNU Lesser General Public License as
008: * published by the Free Software Foundation; either version 2.1 of
009: * the License, or (at your option) any later version.
010: *
011: * This software is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this software; if not, write to the Free
018: * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
019: * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
020: */
021: package org.josso.gateway.identity.service;
022:
023: import org.josso.gateway.session.SSOSession;
024: import org.josso.gateway.session.exceptions.SSOSessionException;
025: import org.josso.gateway.assertion.exceptions.AssertionNotValidException;
026: import org.josso.gateway.assertion.AuthenticationAssertion;
027: import org.josso.gateway.identity.exceptions.SSOIdentityException;
028: import org.josso.gateway.identity.exceptions.IdentityProvisioningException;
029: import org.josso.gateway.SSOContext;
030: import org.josso.gateway.SSOException;
031: import org.josso.auth.Credential;
032: import org.josso.auth.exceptions.SSOAuthenticationException;
033:
034: /**
035: * SSO Identity Provider Business interface.
036: *
037: * @author <a href="mailto:gbrigand@josso.org">Gianluca Brigandi</a>
038: * @version CVS $Id$
039: */
040: public interface SSOIdentityProvider extends java.io.Serializable {
041:
042: ///////////////////////////////////////////////////////////////////
043: // Exposed operations to remote clients (i.e. WS Client).
044: ///////////////////////////////////////////////////////////////////
045:
046: /**
047: * Request an authentication assertion using simple authentication through the
048: * supplied username/password credentials.
049: *
050: * @param username
051: * @param password
052: * @return the assertion identifier
053: */
054: String assertIdentityWithSimpleAuthentication(String username,
055: String password) throws IdentityProvisioningException;
056:
057: /**
058: * Resolves an authentication assertion given its identifier.
059: *
060: */
061: String resolveAuthenticationAssertion(
062: String authenticationAssertionId)
063: throws AssertionNotValidException,
064: IdentityProvisioningException;
065:
066: /**
067: * Performs a global signoff.
068: *
069: * @param sessionId
070: */
071: void globalSignoff(String sessionId)
072: throws IdentityProvisioningException;
073:
074: ///////////////////////////////////////////////////////////////////
075: // Internal operations used only within the gateway application
076: ///////////////////////////////////////////////////////////////////
077:
078: /**
079: * Login a user into the SSO infrastructure.
080: *
081: * @param credentials that proof user identity.
082: * @param scheme the authentication scheme name to be used for
083: * logging in the user.
084: * @param ctx the external context used during method execution
085: *
086: * @return the user information after login.
087: *
088: * @throws org.josso.gateway.SSOException if an error occurs.
089: * @throws org.josso.auth.exceptions.SSOAuthenticationException if user identity cannot be confirmed.
090: */
091: SSOSession login(Credential[] credentials, String scheme,
092: SSOContext ctx) throws SSOException,
093: SSOAuthenticationException;
094:
095: /**
096: * Create an authentication assertion based on the supplied credentials. If assertion is successful a new session
097: * is created for the subject which can be referenced through the corresponding assertion identifier.
098: *
099: * @param credentials that proof user identity.
100: * @param scheme the authentication scheme name to be used for
101: * logging in the user.
102: * @param ctx the external context used during method execution
103: *
104: * @return the user information after login.
105: *
106: * @throws SSOException if an error occurs.
107: * @throws SSOAuthenticationException if user identity cannot be confirmed.
108: */
109: AuthenticationAssertion assertIdentity(Credential[] credentials,
110: String scheme, SSOContext ctx) throws SSOException,
111: SSOAuthenticationException;
112:
113: /**
114: * Create an authentication assertion from a previous existing and valid one.
115: *
116: * @param sessionId SSO session identifier for the session to be bound to the new assertion.
117: * @return
118: * @throws SSOException
119: */
120: AuthenticationAssertion assertIdentity(String sessionId)
121: throws SSOException;
122:
123: /**
124: * Logouts a user from the SSO infrastructure.
125: *
126: * @param ctx the sso external context during method execution
127: * @throws SSOException
128: */
129: void logout(SSOContext ctx) throws SSOException;
130: }
|