[Carbon-commits] [Carbon] svn commit r114250 - in branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2: . src src/main src/main/java src/main/java/org src/main/java/org/wso2 src/main/java/org/wso2/carbon src/main/java/org/wso2/carbon/identity src/main/java/org/wso2/carbon/identity/sts src/main/java/org/wso2/carbon/identity/sts/passive src/main/java/org/wso2/carbon/identity/sts/passive/ui src/main/java/org/wso2/carbon/identity/sts/passive/ui/client src/main/resources src/main/resources/META-INF src/main/resources/org src/main/resources/org/wso2 src/main/resources/org/wso2/carbon src/main/resources/org/wso2/carbon/identity src/main/resources/org/wso2/carbon/identity/sts src/main/resources/org/wso2/carbon/identity/sts/passive src/main/resources/org/wso2/carbon/identity/sts/passive/ui src/main/resources/org/wso2/carbon/identity/sts/passive/ui/i18n src/main/resources/web src/main/resources/web/passive-sts src/main/resources/web/passive-sts/docs src/main/ resources/web/passive-sts/images

manjular at wso2.com manjular at wso2.com
Mon Oct 17 09:30:08 EDT 2011


Author: manjular
Date: Mon Oct 17 06:30:07 2011
New Revision: 114250
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=114250

Log:
updating passive sts client with latest stub changes

Added:
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/pom.xml   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveRequestorConstants.java   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveSTS.java   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/client/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/client/IdentityPassiveSTSClient.java   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/IdentityPassiveSTSService.wsdl   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/META-INF/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/META-INF/component.xml   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/passive/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/passive/ui/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/passive/ui/i18n/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/passive/ui/i18n/Resources.properties   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/docs/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/docs/userguide.html   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/images/
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/login.jsp   (contents, props changed)
   branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/redirect.jsp   (contents, props changed)

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/pom.xml
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/pom.xml?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/pom.xml	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+		~ Copyright (c) 2009-2010, WSO2 Inc. (http://www.wso2.org) All Rights
+		Reserved. ~ ~ 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.
+	-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+	<parent>
+		<groupId>org.wso2.carbon</groupId>
+		<artifactId>identity</artifactId>
+		<version>3.2.0</version>
+        <relativePath>../../pom.xml</relativePath>
+	</parent>
+
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.wso2.carbon</groupId>
+	<artifactId>org.wso2.carbon.identity.sts.passive.ui</artifactId>
+	<packaging>bundle</packaging>
+	<version>3.2.2</version>
+	<name>WSO2 Carbon - Passive STS UI</name>
+	<description>User Identity Provider UI component for WSO2 Carbon</description>
+	<url>http://www.wso2.com</url>
+
+
+	<dependencies>
+		<dependency>
+			<groupId>org.wso2.carbon</groupId>
+			<artifactId>org.wso2.carbon.ui</artifactId>
+		</dependency>
+         <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.logging</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.wso2.carbon</groupId>
+            <artifactId>org.wso2.carbon.identity.sts.passive.stub</artifactId>
+            <version>3.2.2</version>
+        </dependency>
+	</dependencies>
+
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<version>1.4.0</version>
+				<extensions>true</extensions>
+				<configuration>
+					<instructions>
+						<Bundle-SymbolicName>${pom.artifactId}</Bundle-SymbolicName>
+						<Bundle-Name>${pom.artifactId}</Bundle-Name>
+						<Import-Package>
+							!javax.xml.namespace,
+							javax.xml.namespace; version=0.0.0,
+							org.apache.commons.logging.*; version="1.0.4",
+							javax.servlet; version=2.4.0,
+							javax.servlet.http; version=2.4.0,
+							javax.xml.stream.*; version=1.0.1,
+							*;resolution:=optional
+                        </Import-Package>
+						<Export-Package>org.wso2.carbon.identity.sts.passive.ui.*</Export-Package>
+						<Carbon-Component>UIBundle</Carbon-Component>
+						<DynamicImport-Package>*</DynamicImport-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
+
+</project>

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveRequestorConstants.java
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveRequestorConstants.java?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveRequestorConstants.java	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,61 @@
+/*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. licenses this file to you 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.wso2.carbon.identity.sts.passive.ui;
+
+public class PassiveRequestorConstants {
+
+    public final static String REQUESTOR_ACTION_ATTRIBUTES_10 = "wattr1.0";
+
+    public final static String REQUESTOR_ACTION_SIGNIN_10 = "wsignin1.0";
+
+    public final static String REQUESTOR_ACTION_SIGNOUT_10 = "wsignout1.0";
+
+    public final static String REQUESTOR_ACTION_PSEUDONYM_10 = "wpseudo1.0";
+
+    public final static String ACTION = "wa";
+
+    public final static String REPLY_TO = "wreply";
+
+    public final static String RESPONSE = "wres";
+
+    public final static String CONTEXT = "wctx";
+
+    public final static String POLCY = "wp";
+
+    public final static String TIME_AT_RECIPIENT = "wct";
+
+    public final static String REALM = "wtrealm";
+
+    public final static String REQUEST = "wreq";
+
+    public final static String REQUEST_POINTER = "wreqptr";
+
+    public final static String RESULT = "wresult";
+
+    public final static String RESPONSE_POINTER = "wresultptr";
+
+    public final static String ATTRIBUTE = "wattr";
+
+    public final static String PSEUDO = "wpseudo";
+
+    public final static String USER_NAME = "username";
+
+    public final static String PASSWORD = "password";
+    
+    public final static String PASSIVE_REQ_ATTR_MAP = "passiveReqAttrMap";
+}

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveSTS.java
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveSTS.java?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/PassiveSTS.java	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,161 @@
+/*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. licenses this file to you 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.wso2.carbon.identity.sts.passive.ui;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.identity.sts.passive.stub.types.RequestToken;
+import org.wso2.carbon.identity.sts.passive.stub.types.ResponseToken;
+import org.wso2.carbon.identity.sts.passive.ui.client.IdentityPassiveSTSClient;
+import org.wso2.carbon.ui.CarbonUIUtil;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.util.Map;
+
+public class PassiveSTS extends HttpServlet {
+
+    private static final Log log = LogFactory.getLog(PassiveSTS.class);
+
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = 1927253892844132565L;
+
+    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
+            IOException {
+
+        RequestToken reqToken = null;
+        ResponseToken respToken = null;
+
+        String userName = null;
+        String password = null;
+        HttpSession session = null;
+        IdentityPassiveSTSClient passiveSTSClient = null;
+        Map paramMap = req.getParameterMap();
+        String frontEndUrl = null;
+
+        frontEndUrl = getAdminConsoleURL(req);
+
+        session = req.getSession();
+        userName = (String) req.getParameter(PassiveRequestorConstants.USER_NAME);
+        password = (String) req.getParameter(PassiveRequestorConstants.PASSWORD);
+
+        if (userName == null || password == null) {
+            session.setAttribute(PassiveRequestorConstants.ACTION, getAttribute(paramMap,
+                    PassiveRequestorConstants.ACTION));
+            session.setAttribute(PassiveRequestorConstants.ATTRIBUTE, getAttribute(paramMap,
+                    PassiveRequestorConstants.ATTRIBUTE));
+            session.setAttribute(PassiveRequestorConstants.CONTEXT, getAttribute(paramMap,
+                    PassiveRequestorConstants.CONTEXT));
+            session.setAttribute(PassiveRequestorConstants.REPLY_TO, getAttribute(paramMap,
+                    PassiveRequestorConstants.REPLY_TO));
+            session.setAttribute(PassiveRequestorConstants.PSEUDO, getAttribute(paramMap,
+                    PassiveRequestorConstants.PSEUDO));
+            session.setAttribute(PassiveRequestorConstants.REALM, getAttribute(paramMap,
+                    PassiveRequestorConstants.REALM));
+            session.setAttribute(PassiveRequestorConstants.REQUEST, getAttribute(paramMap,
+                    PassiveRequestorConstants.REQUEST));
+            session.setAttribute(PassiveRequestorConstants.REQUEST_POINTER, getAttribute(paramMap,
+                    PassiveRequestorConstants.REQUEST_POINTER));
+            session.setAttribute(PassiveRequestorConstants.POLCY, getAttribute(paramMap,
+                    PassiveRequestorConstants.POLCY));
+            resp.sendRedirect(frontEndUrl + "passive-sts/login.jsp");
+            return;
+        }
+
+        paramMap = (Map) session.getAttribute(PassiveRequestorConstants.PASSIVE_REQ_ATTR_MAP);
+        session.removeAttribute(PassiveRequestorConstants.PASSIVE_REQ_ATTR_MAP);
+
+        reqToken = new RequestToken();
+        reqToken.setAction((String) session.getAttribute(PassiveRequestorConstants.ACTION));
+        reqToken.setAttributes((String) session.getAttribute(PassiveRequestorConstants.ATTRIBUTE));
+        reqToken.setContext((String) session.getAttribute(PassiveRequestorConstants.CONTEXT));
+        reqToken.setReplyTo((String) session.getAttribute(PassiveRequestorConstants.REPLY_TO));
+        reqToken.setPseudo((String) session.getAttribute(PassiveRequestorConstants.PSEUDO));
+        reqToken.setRealm((String) session.getAttribute(PassiveRequestorConstants.REALM));
+        reqToken.setRequest((String) session.getAttribute(PassiveRequestorConstants.REQUEST));
+        reqToken.setRequestPointer((String) session
+                .getAttribute(PassiveRequestorConstants.REQUEST_POINTER));
+        reqToken.setPolicy((String) session.getAttribute(PassiveRequestorConstants.POLCY));
+        reqToken.setUserName(userName);
+        reqToken.setPassword(password);
+
+        String serverURL = CarbonUIUtil.getServerURL(session.getServletContext(), session);
+        ConfigurationContext configContext = (ConfigurationContext) session.getServletContext()
+                .getAttribute(CarbonConstants.CONFIGURATION_CONTEXT);
+        passiveSTSClient = new IdentityPassiveSTSClient(serverURL, configContext);
+
+        respToken = passiveSTSClient.getResponse(reqToken);
+
+        if (respToken != null && respToken.getAuthenticated()) {
+            sendData(req, resp, respToken, frontEndUrl, reqToken.getAction());
+        } else {
+            resp.sendRedirect(frontEndUrl + "passive-sts/login.jsp");
+            return;
+        }
+    }
+    
+    private void sendData(HttpServletRequest httpReq, HttpServletResponse httpResp,
+            ResponseToken respToken, String frontEndUrl, String action) throws ServletException,
+            IOException {
+        String page = null;
+        HttpSession session = null;
+        page = frontEndUrl + "passive-sts/redirect.jsp";
+
+        session = httpReq.getSession();
+
+        respToken.setResults(respToken.getResults().replace("<", "<"));
+        respToken.setResults(respToken.getResults().replace(">", ">"));
+        respToken.setResults(respToken.getResults().replace("\"", "'"));
+
+        // HTML FORM Redirection
+        session.setAttribute("replyTo", respToken.getReplyTo());
+        session.setAttribute("results", respToken.getResults());
+        session.setAttribute("context", respToken.getContext());
+        session.setAttribute("action", action);
+        httpResp.sendRedirect(page);
+    }
+
+    private String getAttribute(Map paramMap, String name) {
+        if (paramMap.get(name) != null && paramMap.get(name) instanceof String[]) {
+            return ((String[]) paramMap.get(name))[0];
+        }
+        return null;
+    }
+
+    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
+            throws ServletException, IOException {
+        doGet(req, resp);
+    }
+
+    private String getAdminConsoleURL(HttpServletRequest request) {
+        String url = CarbonUIUtil.getAdminConsoleURL(request);
+        if (url.indexOf("/passivests/") != -1) {
+            url = url.replace("/passivests", "");
+        }
+        return url;
+    }
+
+}

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/client/IdentityPassiveSTSClient.java
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/client/IdentityPassiveSTSClient.java?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/java/org/wso2/carbon/identity/sts/passive/ui/client/IdentityPassiveSTSClient.java	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,93 @@
+/*
+*  Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+*
+*  WSO2 Inc. licenses this file to you 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.wso2.carbon.identity.sts.passive.ui.client;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.identity.sts.passive.stub.IdentityPassiveSTSServiceStub;
+import org.wso2.carbon.identity.sts.passive.stub.types.ClaimDTO;
+import org.wso2.carbon.identity.sts.passive.stub.types.RequestToken;
+import org.wso2.carbon.identity.sts.passive.stub.types.ResponseToken;
+
+public class IdentityPassiveSTSClient {
+
+    private static final Log log = LogFactory.getLog(IdentityPassiveSTSClient.class);
+
+    private IdentityPassiveSTSServiceStub stub = null;
+
+    public IdentityPassiveSTSClient(String backendServerURL, ConfigurationContext configCtx)
+            throws AxisFault {
+        String serviceURL = backendServerURL + "IdentityPassiveSTSService";
+        stub = new IdentityPassiveSTSServiceStub(configCtx, serviceURL);
+        ServiceClient client = stub._getServiceClient();
+        Options option = client.getOptions();
+        option.setManageSession(true);
+    }
+
+    public ResponseToken getResponse(RequestToken request) throws AxisFault {
+        try {
+            return stub.getResponse(request);
+        } catch (Exception e) {
+            handleException("Error ouccured getting the response from the backend service", e);
+        }     
+        return null;
+    }
+
+    /**
+     * Logs and wraps the given exception.
+     * 
+     * @param msg
+     *            Error message
+     * @param e
+     *            Exception
+     * @throws org.apache.axis2.AxisFault
+     */
+    private void handleException(String msg, Exception e) throws AxisFault {
+        log.error(msg, e);
+        throw new AxisFault(msg, e);
+    }
+
+    public void addTrustedService(String realmName, String claims) throws AxisFault {
+        try {
+            stub.addTrustedService(realmName, claims);
+        } catch (Exception e) {
+            handleException("Error occurred while adding the trusted service: " + realmName, e);
+        }
+    }
+
+    public void removeTrustedService(String realmName) throws AxisFault {
+        try {
+            stub.removeTrustedService(realmName);
+        } catch (Exception e) {
+            handleException("Error occurred while removing the trusted service: " + realmName, e);
+        }
+    }
+
+    public ClaimDTO[] getAllTrustedServices() throws AxisFault {
+        try {
+            return stub.getAllTrustedServices();
+        } catch (Exception e) {
+             handleException("Error occurred while getting all trusted services.", e);
+        }
+        return new ClaimDTO[0];
+    }
+}

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/IdentityPassiveSTSService.wsdl
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/IdentityPassiveSTSService.wsdl?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/IdentityPassiveSTSService.wsdl	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,148 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. licenses this file to you 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.
+ -->
+<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:axis2="http://passive.sts.identity.carbon.wso2.org" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ax2111="http://passive.sts.identity.carbon.wso2.org/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://passive.sts.identity.carbon.wso2.org">
+    <wsdl:documentation>IdentityPassiveSTSService</wsdl:documentation>
+    <wsdl:types>
+        <xs:schema xmlns:ns="http://org.apache.axis2/xsd" xmlns:ax2112="http://passive.sts.identity.carbon.wso2.org/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://org.apache.axis2/xsd">
+            <xs:import namespace="http://passive.sts.identity.carbon.wso2.org/xsd" />
+            <xs:complexType name="Exception">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType" />
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="Exception">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="Exception" nillable="true" type="ns:Exception" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="request" nillable="true" type="ax2111:RequestToken" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="getResponseResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="ax2111:ResponseToken" />
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+        </xs:schema>
+        <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://passive.sts.identity.carbon.wso2.org/xsd">
+            <xs:complexType name="RequestToken">
+                <xs:all>
+                    <xs:element minOccurs="0" name="action" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="attributes" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="context" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="currentTimeAtRecepient" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="password" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="policy" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="pseudo" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="realm" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="replyTo" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="request" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="requestPointer" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="responseTo" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="userName" nillable="true" type="xs:string" />
+                </xs:all>
+            </xs:complexType>
+            <xs:complexType name="ResponseToken">
+                <xs:all>
+                    <xs:element minOccurs="0" name="authenticated" type="xs:boolean" />
+                    <xs:element minOccurs="0" name="context" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="replyTo" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="responsePointer" nillable="true" type="xs:string" />
+                    <xs:element minOccurs="0" name="results" nillable="true" type="xs:string" />
+                </xs:all>
+            </xs:complexType>
+        </xs:schema>
+    </wsdl:types>
+    <wsdl:message name="getResponseRequest">
+        <wsdl:part name="parameters" element="ns1:getResponse" />
+    </wsdl:message>
+    <wsdl:message name="getResponseResponse">
+        <wsdl:part name="parameters" element="ns1:getResponseResponse" />
+    </wsdl:message>
+    <wsdl:message name="Exception">
+        <wsdl:part name="parameters" element="ns1:Exception" />
+    </wsdl:message>
+    <wsdl:portType name="IdentityPassiveSTSServicePortType">
+        <wsdl:operation name="getResponse">
+            <wsdl:input message="axis2:getResponseRequest" wsaw:Action="urn:getResponse" />
+            <wsdl:output message="axis2:getResponseResponse" wsaw:Action="urn:getResponseResponse" />
+            <wsdl:fault message="axis2:Exception" name="Exception" wsaw:Action="urn:getResponseException" />
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="IdentityPassiveSTSServiceSoap11Binding" type="axis2:IdentityPassiveSTSServicePortType">
+        <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="getResponse">
+            <soap:operation soapAction="urn:getResponse" style="document" />
+            <wsdl:input>
+                <soap:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="Exception">
+                <soap:fault use="literal" name="Exception" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="IdentityPassiveSTSServiceSoap12Binding" type="axis2:IdentityPassiveSTSServicePortType">
+        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+        <wsdl:operation name="getResponse">
+            <soap12:operation soapAction="urn:getResponse" style="document" />
+            <wsdl:input>
+                <soap12:body use="literal" />
+            </wsdl:input>
+            <wsdl:output>
+                <soap12:body use="literal" />
+            </wsdl:output>
+            <wsdl:fault name="Exception">
+                <soap12:fault use="literal" name="Exception" />
+            </wsdl:fault>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:binding name="IdentityPassiveSTSServiceHttpBinding" type="axis2:IdentityPassiveSTSServicePortType">
+        <http:binding verb="POST" />
+        <wsdl:operation name="getResponse">
+            <http:operation location="getResponse" />
+            <wsdl:input>
+                <mime:content type="text/xml" part="getResponse" />
+            </wsdl:input>
+            <wsdl:output>
+                <mime:content type="text/xml" part="getResponse" />
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="IdentityPassiveSTSService">
+        <wsdl:port name="IdentityPassiveSTSServiceHttpsSoap11Endpoint" binding="axis2:IdentityPassiveSTSServiceSoap11Binding">
+            <soap:address location="https://localhost:9443/services/IdentityPassiveSTSService.IdentityPassiveSTSServiceHttpsSoap11Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="IdentityPassiveSTSServiceHttpsSoap12Endpoint" binding="axis2:IdentityPassiveSTSServiceSoap12Binding">
+            <soap12:address location="https://localhost:9443/services/IdentityPassiveSTSService.IdentityPassiveSTSServiceHttpsSoap12Endpoint/" />
+        </wsdl:port>
+        <wsdl:port name="IdentityPassiveSTSServiceHttpsEndpoint" binding="axis2:IdentityPassiveSTSServiceHttpBinding">
+            <http:address location="https://localhost:9443/services/IdentityPassiveSTSService.IdentityPassiveSTSServiceHttpsEndpoint/" />
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>
\ No newline at end of file

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/META-INF/component.xml
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/META-INF/component.xml?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/META-INF/component.xml	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,40 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. licenses this file to you 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.
+ -->
+<component xmlns="http://products.wso2.org/carbon">
+	<menus>
+		<menu>
+			<id>opprovider_menu</id>
+			<i18n-key>passive.sts</i18n-key>
+			<i18n-bundle>org.wso2.carbon.identity.sts.passive.ui.i18n.Resources</i18n-bundle>
+			<link>../passive-sts/login.jsp</link>
+			<skip-authentication>
+				<skip-link>../passive-sts/login.jsp</skip-link>		
+				<skip-link>../passive-sts/redirect.jsp</skip-link>	
+			</skip-authentication>
+		</menu>
+	</menus>
+
+	<servlets>
+		<servlet id="passiveSTS">
+			<servlet-name>PassiveSTSServlet</servlet-name>
+			<url-pattern>/passivests</url-pattern>
+			<display-name>Passive STS Servlet</display-name>
+			<servlet-class>org.wso2.carbon.identity.sts.passive.ui.PassiveSTS</servlet-class>
+		</servlet>
+	</servlets>
+</component>

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/passive/ui/i18n/Resources.properties
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/passive/ui/i18n/Resources.properties?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/org/wso2/carbon/identity/sts/passive/ui/i18n/Resources.properties	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,6 @@
+passive.sts=Passive STS
+enter.password.to.signin=Please enter your credentials to sign in to WSO2 Identity Server Passive STS
+username=User Name
+password=Password
+login=Sign In
+

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/docs/userguide.html
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/docs/userguide.html?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/docs/userguide.html	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,45 @@
+<!--
+  ~ Copyright 2008 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+  <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"></meta>
+  <title>Entitlement Management - User Guide</title>
+  <link href="../../admin/css/documentation.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body style="font-family: Times New Roman,Times,serif; font-size: 12pt;">
+<h1>Entitlement Management</h1>
+
+<p><img alt="" src="../images/entitlement.png"/></p>
+<p>Figure 1: Entitlement Management</p>
+
+<p>The Entitlement Management component of the WSO2 Carbon facilitates the management
+and control of policies defined in XACML. The key functionalities of this component includes:</p>
+<ul>
+  <li>Add new XACML policy</li>
+  <li>Import existing XACML policy</li>
+  <li>Evaluate already defined XACML policies</li>
+</ul>
+
+<p>External References:</p>
+<ul>
+  <li><a href="http://blog.facilelogin.com/2009/05/identity-server-20-as-xacml-engine.html">Identity Server 2.0 as an XACML engine</a></li>
+  <li><a href="http://blog.facilelogin.com/2009/05/adding-fine-grained-authorization-for.html">Adding fine-grained authorization for proxy services in WSO2 ESB</a></li>
+  <li><a href="http://blog.facilelogin.com/2009/06/guide-to-write-xacml-policies-in-wso2.html">Guide to write XACML policies in WSO2 Identity Server 2.0 - Part - I</a></li>
+</ul>
+</body>
+</html>

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/login.jsp
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/login.jsp?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/login.jsp	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,79 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. licenses this file to you 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.
+ -->
+<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
+<%@ taglib uri="http://wso2.org/projects/carbon/taglibs/carbontags.jar"
+           prefix="carbon" %>
+<jsp:include page="../dialog/display_messages.jsp"/>
+
+
+<link
+        media="all" type="text/css" rel="stylesheet"
+        href="css/registration.css"/>
+
+<fmt:bundle  basename="org.wso2.carbon.identity.sts.passive.ui.i18n.Resources">
+
+<script type="text/javascript">
+     function doLogin(){
+        var loginForm = document.getElementById('loginForm');
+        loginForm.submit();
+    }
+</script>
+
+    <div id="middle">
+        <h2><fmt:message key='passive.sts'/></h2>
+
+        <div id="workArea">
+            <table style="width:100%">
+                <tr>
+                    <td style="width:50%" id="loginTable">
+                        <form action="../../passivests" method="post" id="loginForm">
+                                           
+                            <div id="loginbox" class="identity-box">
+                                <strong id="loginDisplayText"><fmt:message key='enter.password.to.signin'/></strong>
+
+                                <h2></h2>
+                                <table id="loginTable">
+                                    <tr height="22">
+                                        <td colspan="2"></td>
+                                    </tr>
+                                    <tr>
+                                        <td><fmt:message key='username'/></td>
+                                        <td>
+                                            <input type="text" id='username' name="username" size='30'/>
+                                        </td>
+                                    </tr>
+                                    <tr>     
+                                        <td><fmt:message key='password'/></td>                     
+                                        <td>
+                                            <input type="password" id='password' name="password" size='30'/>
+                                        </td>                                 
+                                    </tr>
+                                    <tr> 
+                                        <td colspan="2">
+                                            <input type="submit" value="<fmt:message key='login'/>" class="button">
+                                        </td>
+                                    </tr>
+                                </table>
+                            </div>
+                        </form>
+                    </td>   
+                </tr>
+            </table>
+        </div>
+    </div>
+</fmt:bundle>
\ No newline at end of file

Added: branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/redirect.jsp
URL: http://wso2.org/svn/browse/wso2/branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/redirect.jsp?pathrev=114250
==============================================================================
--- (empty file)
+++ branches/carbon/3.2.0/components/identity/org.wso2.carbon.identity.sts.passive.ui/3.2.2/src/main/resources/web/passive-sts/redirect.jsp	Mon Oct 17 06:30:07 2011
@@ -0,0 +1,39 @@
+<!--
+ ~ Copyright (c) 2005-2010, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+ ~
+ ~ WSO2 Inc. licenses this file to you 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.
+ -->
+
+<%@page import="java.net.URLDecoder"%>
+<%@page import="java.net.URLEncoder"%><html>
+<head></head>
+<body>
+
+<form method="post" action="<%=session.getAttribute("replyTo")%>">
+<p><input type="hidden" name="wa"
+	value="<%=session.getAttribute("action")%>" /> <input type="hidden"
+	name="wresult" value="<%=session.getAttribute("results")%>" />
+	<input type="hidden"
+	name="wctx" value="<%=session.getAttribute("context")%>" />
+<button type="submit">POST</button>
+</p>
+</form>
+
+<script type="text/javascript">
+   document.forms[0].submit();
+</script>
+
+</body>
+</html>
\ No newline at end of file


More information about the Carbon-commits mailing list