Merge pull request #9 from dulichan/master

SSO related fixes and CDM app integration
revert-dabc3590
Prabath Abeysekara 10 years ago
commit 68bff9c21c

@ -112,7 +112,7 @@
<outputDirectory>wso2mdm-${project.version}/repository/conf</outputDirectory>
<includes>
<include>**/api-manager.xml</include>
<include>**/sso-idp-config.xml</include>
<include>**/security/</include>
<!-- <include>**/emm-config.xml</include>-->
</includes>
</fileSet>
@ -126,7 +126,15 @@
<include>**/trusted-idp-config.xml</include>
</includes>
</fileSet>
<fileSet>
<directory>
src/repository/conf/identity/
</directory>
<outputDirectory>wso2mdm-${project.version}/repository/conf/identity/</outputDirectory>
<includes>
<include>**/**</include>
</includes>
</fileSet>
<fileSet>
<directory>src/repository/conf/datasources</directory>
<outputDirectory>wso2mdm-${project.version}/repository/conf/datasources
@ -224,6 +232,16 @@
</outputDirectory>
<fileMode>755</fileMode>
</fileSet>
<!-- Copying Authentication Endpoint webapp -->
<fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/deployment/server/webapps
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/deployment/server/webapps</outputDirectory>
<includes>
<include>authenticationendpoint.war</include>
</includes>
</fileSet>
<!-- Copying API Manager Publisher and Store Jaggery apps -->
<fileSet>
@ -280,6 +298,7 @@
</outputDirectory>
<fileMode>755</fileMode>
</file>
<!--> <-->
<file>
<source>../tools/mdm-android-agent-archetype/target/mdm-android-agent-archetype-${mdm.android.agent.archetype.version}.jar</source>
@ -390,6 +409,7 @@
<fileMode>644</fileMode>
</file>
<!-- Copying thrift-authentication.xml -->
<file>
<source>
@ -429,6 +449,11 @@
<outputDirectory>wso2mdm-${project.version}/repository/conf</outputDirectory>
<fileMode>644</fileMode>
</file>
<file>
<source>src/repository/conf/security/sso-idp-config.xml</source>
<outputDirectory>wso2mdm-${project.version}/repository/conf/security</outputDirectory>
<fileMode>644</fileMode>
</file>
<file>
<source>

@ -198,7 +198,25 @@
</MultifactorAuthentication>
<SSOService>
<EntityId>localhost</EntityId>
<IdentityProviderURL>https://localhost:9443/samlsso</IdentityProviderURL>
<SingleLogoutRetryCount>5</SingleLogoutRetryCount>
<SingleLogoutRetryInterval>60000</SingleLogoutRetryInterval> <!-- in milli seconds -->
<TenantPartitioningEnabled>false</TenantPartitioningEnabled>
<SessionTimeout>36000</SessionTimeout> <!-- remember me session timeout in seconds -->
<!-- skips authentication if valid SAML2 Web SSO browser session available -->
<AttributeStatementBuilder>org.wso2.carbon.identity.sso.saml.attributes.UserAttributeStatementBuilder</AttributeStatementBuilder>
<AttributesClaimDialect>http://wso2.org/claims</AttributesClaimDialect>
<AcceptOpenIDLogin>false</AcceptOpenIDLogin>
<ClaimsRetrieverImplClass>org.wso2.carbon.identity.sso.saml.builders.claims.DefaultClaimsRetriever</ClaimsRetrieverImplClass>
<SAMLSSOEncrypter>org.wso2.carbon.identity.sso.saml.builders.encryption.DefaultSSOEncrypter</SAMLSSOEncrypter>
<SAMLSSOSigner>org.wso2.carbon.identity.sso.saml.builders.signature.DefaultSSOSigner</SAMLSSOSigner>
<SAML2HTTPRedirectSignatureValidator>org.wso2.carbon.identity.sso.saml.validators.SAML2HTTPRedirectDeflateSignatureValidator</SAML2HTTPRedirectSignatureValidator>
<!--SAMLSSOResponseBuilder>org.wso2.carbon.identity.sso.saml.builders.DefaultResponseBuilder</SAMLSSOResponseBuilder-->
<!-- SAML Token validity period in minutes -->
<SAMLResponseValidityPeriod>5</SAMLResponseValidityPeriod>
<UseAuthenticatedUserDomain>false</UseAuthenticatedUserDomain>
</SSOService>
<EntitlementSettings>

@ -0,0 +1,24 @@
<IdentityProvider>
<IdentityProviderName>default</IdentityProviderName>
<DisplayName>default</DisplayName>
<IdentityProviderDescription></IdentityProviderDescription>
<Alias></Alias>
<IsPrimary></IsPrimary>
<IsFederationHub></IsFederationHub>
<HomeRealmId></HomeRealmId>
<ProvisioningRole></ProvisioningRole>
<FederatedAuthenticatorConfigs></FederatedAuthenticatorConfigs>
<DefaultAuthenticatorConfig>
</DefaultAuthenticatorConfig>
<ProvisioningConnectorConfigs>
<ProvisioningConnectorConfig>
<ProvisioningProperties>
</ProvisioningProperties>
</ProvisioningConnectorConfig>
</ProvisioningConnectorConfigs>
<DefaultProvisioningConnectorConfig></DefaultProvisioningConnectorConfig>
<ClaimConfig></ClaimConfig>
<Certificate></Certificate>
<PermissionAndRoleConfig></PermissionAndRoleConfig>
<JustInTimeProvisioningConfig></JustInTimeProvisioningConfig>
</IdentityProvider>

@ -0,0 +1,49 @@
<ServiceProvider>
<ApplicationID>1</ApplicationID>
<ApplicationName>default</ApplicationName>
<Description>Default Service Provider</Description>
<InboundAuthenticationConfig>
<InboundAuthenticationRequestConfigs>
<InboundAuthenticationRequestConfig>
<InboundAuthKey>default</InboundAuthKey>
<InboundAuthType></InboundAuthType>
<Properties></Properties>
</InboundAuthenticationRequestConfig>
</InboundAuthenticationRequestConfigs>
</InboundAuthenticationConfig>
<LocalAndOutBoundAuthenticationConfig>
<AuthenticationSteps>
<AuthenticationStep>
<StepOrder>1</StepOrder>
<LocalAuthenticatorConfigs>
<LocalAuthenticatorConfig>
<Name>BasicAuthenticator</Name>
<DisplayName>basicauth</DisplayName>
<IsEnabled>true</IsEnabled>
</LocalAuthenticatorConfig>
</LocalAuthenticatorConfigs>
<!-- FederatedIdentityProviders>
<IdentityProvider>
<IdentityProviderName>facebook</IdentityProviderName>
<IsEnabled>true</IsEnabled>
<DefaultAuthenticatorConfig>
<FederatedAuthenticatorConfig>
<Name>FacebookAuthenticator</Name>
<IsEnabled>true</IsEnabled>
</FederatedAuthenticatorConfig>
</DefaultAuthenticatorConfig>
</IdentityProvider>
</FederatedIdentityProviders -->
<SubjectStep>true</SubjectStep>
<AttributeStep>true</AttributeStep>
</AuthenticationStep>
</AuthenticationSteps>
</LocalAndOutBoundAuthenticationConfig>
<RequestPathAuthenticatorConfigs></RequestPathAuthenticatorConfigs>
<InboundProvisioningConfig></InboundProvisioningConfig>
<OutboundProvisioningConfig></OutboundProvisioningConfig>
<ClaimConfig>
<AlwaysSendMappedLocalSubjectId>true</AlwaysSendMappedLocalSubjectId>
</ClaimConfig>
<PermissionAndRoleConfig></PermissionAndRoleConfig>
</ServiceProvider>

@ -0,0 +1,49 @@
<ServiceProvider>
<ApplicationID>2</ApplicationID>
<ApplicationName>wso2_cdm</ApplicationName>
<Description>CDM</Description>
<InboundAuthenticationConfig>
<InboundAuthenticationRequestConfigs>
<InboundAuthenticationRequestConfig>
<InboundAuthKey>cdm</InboundAuthKey>
<InboundAuthType>samlsso</InboundAuthType>
<Properties></Properties>
</InboundAuthenticationRequestConfig>
</InboundAuthenticationRequestConfigs>
</InboundAuthenticationConfig>
<LocalAndOutBoundAuthenticationConfig>
<AuthenticationSteps>
<AuthenticationStep>
<StepOrder>1</StepOrder>
<LocalAuthenticatorConfigs>
<LocalAuthenticatorConfig>
<Name>BasicAuthenticator</Name>
<DisplayName>basicauth</DisplayName>
<IsEnabled>true</IsEnabled>
</LocalAuthenticatorConfig>
</LocalAuthenticatorConfigs>
<!-- FederatedIdentityProviders>
<IdentityProvider>
<IdentityProviderName>facebook</IdentityProviderName>
<IsEnabled>true</IsEnabled>
<DefaultAuthenticatorConfig>
<FederatedAuthenticatorConfig>
<Name>FacebookAuthenticator</Name>
<IsEnabled>true</IsEnabled>
</FederatedAuthenticatorConfig>
</DefaultAuthenticatorConfig>
</IdentityProvider>
</FederatedIdentityProviders -->
<SubjectStep>true</SubjectStep>
<AttributeStep>true</AttributeStep>
</AuthenticationStep>
</AuthenticationSteps>
</LocalAndOutBoundAuthenticationConfig>
<RequestPathAuthenticatorConfigs></RequestPathAuthenticatorConfigs>
<InboundProvisioningConfig></InboundProvisioningConfig>
<OutboundProvisioningConfig></OutboundProvisioningConfig>
<ClaimConfig>
<AlwaysSendMappedLocalSubjectId>true</AlwaysSendMappedLocalSubjectId>
</ClaimConfig>
<PermissionAndRoleConfig></PermissionAndRoleConfig>
</ServiceProvider>

@ -0,0 +1,49 @@
<!--
~ 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.
-->
<SSOIdentityProviderConfig>
<TenantRegistrationPage>https://stratos-local.wso2.com/carbon/tenant-register/select_domain.jsp</TenantRegistrationPage>
<!-- <ServiceProviders>
<ServiceProvider>
<Issuer>cdm</Issuer>
<AssertionConsumerService>https://localhost:9443/cdm/acs</AssertionConsumerService>
<SignResponse>true</SignResponse>
<CustomLoginPage>/cdm/login</CustomLoginPage>
</ServiceProvider>
</ServiceProviders> -->
<ServiceProviders>
<ServiceProvider>
<Issuer>cdm</Issuer>
<AssertionConsumerService>https://localhost:9443/cdm/acs</AssertionConsumerService>
<SignAssertion>true</SignAssertion>
<SignResponse>true</SignResponse>
<EnableAttributeProfile>false</EnableAttributeProfile>
<IncludeAttributeByDefault>false</IncludeAttributeByDefault>
<Claims>
<Claim>http://wso2.org/claims/role</Claim>
<Claim>http://wso2.org/claims/emailaddress</Claim>
</Claims>
<EnableSingleLogout>false</EnableSingleLogout>
<SingleLogoutUrl></SingleLogoutUrl>
<EnableAudienceRestriction>true</EnableAudienceRestriction>
<AudiencesList>
<Audience>carbonServer</Audience>
</AudiencesList>
<ConsumingServiceIndex></ConsumingServiceIndex>
</ServiceProvider>
</ServiceProviders>
</SSOIdentityProviderConfig>

@ -1,52 +0,0 @@
<!--
~ 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.
-->
<SSOIdentityProviderConfig>
<TenantRegistrationPage>https://stratos-local.wso2.com/carbon/tenant-register/select_domain.jsp</TenantRegistrationPage>
<ServiceProviders>
<ServiceProvider>
<Issuer>store</Issuer>
<AssertionConsumerService>https://localhost:9443/store/acs</AssertionConsumerService>
<SignResponse>true</SignResponse>
<CustomLoginPage>/store/login.jag</CustomLoginPage>
</ServiceProvider>
<ServiceProvider>
<Issuer>social</Issuer>
<AssertionConsumerService>https://localhost:9443/social/acs</AssertionConsumerService>
<SignResponse>true</SignResponse>
<CustomLoginPage>/social/login</CustomLoginPage>
</ServiceProvider>
<ServiceProvider>
<Issuer>publisher</Issuer>
<AssertionConsumerService>https://localhost:9443/publisher/acs</AssertionConsumerService>
<SignResponse>true</SignResponse>
<CustomLoginPage>/publisher/controllers/login.jag</CustomLoginPage>
</ServiceProvider>
<ServiceProvider>
<Issuer>emm</Issuer>
<AssertionConsumerService>https://localhost:9443/emm/acs</AssertionConsumerService>
<SignResponse>true</SignResponse>
<CustomLoginPage>/emm/login</CustomLoginPage>
</ServiceProvider>
<ServiceProvider>
<Issuer>mam</Issuer>
<AssertionConsumerService>https://localhost:9443/mam/acs</AssertionConsumerService>
<SignResponse>true</SignResponse>
<CustomLoginPage>/mam/login</CustomLoginPage>
</ServiceProvider>
</ServiceProviders>
</SSOIdentityProviderConfig>

@ -25,7 +25,6 @@ var deviceModule = require("/modules/device.js");
if (uri != null) {
var uriMatcher = new URIMatcher(callPath);
log.info(callPath);
if (uriMatcher.match("devices/mobile/{type}/{deviceid}/")) {
var deviceId = uriMatcher.elements().deviceid;
var type = uriMatcher.elements().type;

@ -25,16 +25,12 @@ var deviceModule = require("/modules/device.js");
if (uri != null) {
var uriMatcher = new URIMatcher(callPath);
//log.info(callPath);
log.info(uriMatcher.match("operation/{type}/{deviceid}/{operation}"));
if (uriMatcher.match("operation/{type}/{deviceid}/{operation}")) {
var deviceId = uriMatcher.elements().deviceid;
var type = uriMatcher.elements().type;
var operation = uriMatcher.elements().operation;
var result = deviceModule.performOperation(deviceId, operation,[],type);
<!--log.info(result);-->
<!--print(result);-->
}
}
%>

@ -1,13 +0,0 @@
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')

@ -0,0 +1,16 @@
{
"APP_CONTEXT" : "/cdm/",
"API_CONTEXT" : "api",
"HTTPS_URL": "%https.ip%",
"HTTP_URL": "%http.ip%",
"ssoConfiguration": {
"enabled": true,
"issuer": "cdm",
"identityProviderURL": "%https.ip%/sso/samlsso.jag",
"keyStorePassword": "wso2carbon",
"identityAlias": "wso2carbon",
"responseSigningEnabled": "true",
"storeAcs": "%https.ip%/emm/acs",
"keyStoreName": "/repository/resources/security/wso2carbon.jks"
}
}

@ -1,76 +1,35 @@
<%
var dataConfi = require('/config/emm.js').config();
/*
* Copyright (c) 2015, 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.
*/
var dataConfig = require('/modules/mdm-props.js').config();
var sso = require("/modules/sso.js").sso;
var log = new Log();
var keyStoreParams = {
keyStoreName: dataConfi.ssoConfiguration.keyStoreName,
keyStorePassword: dataConfi.ssoConfiguration.keyStorePassword,
identityAlias: dataConfi.ssoConfiguration.identityAlias
keyStoreName: dataConfig.ssoConfiguration.keyStoreName,
keyStorePassword: dataConfig.ssoConfiguration.keyStorePassword,
identityAlias: dataConfig.ssoConfiguration.identityAlias
}
sso.configure(dataConfi.ssoConfiguration.issuer, "emm", keyStoreParams, dataConfi.ssoConfiguration.identityProviderURL);
sso.configure(dataConfig.ssoConfiguration.issuer, "cdm", keyStoreParams, dataConfig.ssoConfiguration.identityProviderURL);
sso.acs(function(loggedInUser) {
session.put("LOGGED_IN_USER", loggedInUser);
session.put("Loged", "true");
session.put("USER", loggedInUser);
var username = loggedInUser;
var userModule = require('/modules/user.js').user;
var db = common.getDatabase();
var user = new userModule(db);
var objUser = user.getUser({
'userid': username,
login: true
});
if (objUser != null) {
var userFeed = {};
userFeed.tenantId = stringify(objUser["tenantId"]);
userFeed.username = objUser["username"];
userFeed.email = objUser["email"];
userFeed.firstName = objUser["firstName"];
userFeed.lastName = objUser["lastName"];
userFeed.mobile = objUser["mobile"];
userFeed.tenantDomain = user.getTenantDomainFromID(stringify(objUser["tenantId"]));
var parsedRoles = parse(objUser["roles"]);
userFeed.roles = parsedRoles;
var isEMMAdmin = false;
var isAdmin = false;
for (var i = 0; i < parsedRoles.length; i++) {
if (parsedRoles[i] == 'Internal/emmadmin') {
isEMMAdmin = true;
break;
}
if (parsedRoles[i] == 'admin') {
isAdmin = true;
isEMMAdmin = true;
break;
}
}
userFeed.isEMMAdmin = isEMMAdmin;
userFeed.isAdmin = isAdmin;
session.put("emmConsoleUserLogin", "true");
session.put("emmConsoleUser", userFeed);
//var db = common.getDatabase();
var startupModule = require('/modules/startup.js').startup;
var startup = new startupModule(db);
startup.onUserLogin(userFeed);
var groupModule = require('/modules/group.js').group;
var group = new groupModule(db);
if (!group.roleExists("Internal/emmadmin")) {
var userList = new Array();
group.addGroup({
'name': 'Internal/emmadmin',
'users': userList
});
}
var appController = require('/controller/app.js');
if (isAdmin || isEMMAdmin) {
response.sendRedirect('console/dashboard');
} else {
response.sendRedirect(appController.appInfo().server_url + 'users/devices?user=' + userFeed.username);
}
}
log.debug("User logged in: "+username);
response.sendRedirect('/cdm/dashboard');
}, function() {
response.sendRedirect('/emm');
response.sendRedirect('/cdm');
}); %>

@ -1,17 +1,35 @@
<%
/*
* Copyright (c) 2015, 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.
*/
(function(){
if (!session.get("emmConsoleUserLogin")) {
var dataConfi = require('/config/emm.js').config();
if (!session.get("USER")) {
var dataConfig = require('/modules/mdm-props.js').config();
var sso = require("/modules/sso.js").sso;
var keyStoreParams = {
keyStoreName : dataConfi.ssoConfiguration.keyStoreName,
keyStorePassword : dataConfi.ssoConfiguration.keyStorePassword,
identityAlias : dataConfi.ssoConfiguration.identityAlias
keyStoreName : dataConfig.ssoConfiguration.keyStoreName,
keyStorePassword : dataConfig.ssoConfiguration.keyStorePassword,
identityAlias : dataConfig.ssoConfiguration.identityAlias
}
sso.configure(dataConfi.ssoConfiguration.issuer, "emm", keyStoreParams, dataConfi.ssoConfiguration.identityProviderURL);
sso.configure(dataConfig.ssoConfiguration.issuer, "cdm", keyStoreParams, dataConfig.ssoConfiguration.identityProviderURL);
sso.login();
}else{
response.sendRedirect("/emm");
response.sendRedirect("/cdm");
}
}());
%>

@ -1,15 +1,32 @@
<%
var user = session.get("emmConsoleUser");
/*
* Copyright (c) 2015, 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.
*/
var user = session.get("USER");
if (user === null) {
response.sendRedirect('/emm');
response.sendRedirect('/cdm/dashboard');
} else {
var dataConfi = require('/config/emm.js').config();
var dataConfi = require('/modules/mdm-props.js').config();
var sso = require("/modules/sso.js").sso;
var keyStoreParams = {
keyStoreName: dataConfi.ssoConfiguration.keyStoreName,
keyStorePassword: dataConfi.ssoConfiguration.keyStorePassword,
identityAlias: dataConfi.ssoConfiguration.identityAlias
}
sso.configure(dataConfi.ssoConfiguration.issuer, "emm", keyStoreParams, dataConfi.ssoConfiguration.identityProviderURL);
sso.configure(dataConfi.ssoConfiguration.issuer, "cdm", keyStoreParams, dataConfi.ssoConfiguration.identityProviderURL);
sso.logout(user);
} %>

@ -1,6 +1,6 @@
[
{
"appName": "8d748f0b-5781-4071",
"packageName": "Dulitha's iPhone"
"packageName": "Appzone"
}
]

@ -1,3 +1,23 @@
<%
// This will have the auth headers
/*
* Copyright (c) 2015, 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.
*/
var loggedUser = session.get("USER");
if(loggedUser==null){
response.sendRedirect("/cdm/login");
}
%>

@ -1,4 +1,21 @@
<%
/*
* Copyright (c) 2015, 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.
*/
// footer includes
%>
<!-- Modal -->

@ -1,4 +1,21 @@
<%
/*
* Copyright (c) 2015, 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.
*/
// header includes
var ui_config = require("/config/ui.json");
%>
@ -18,6 +35,7 @@
<li><a href="/cdm/dashboard">Dashboard</a></li>
<li><a href="#">Configuration</a></li>
<li><a href="#">Management</a></li>
<li><a href="/cdm/logout">Logout</a></li>
</ul>
</div>
</div>

@ -1,3 +1,22 @@
<%
/*
* Copyright (c) 2015, 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.
*/
%>
<!-- Bootstrap core JavaScript
=== === === === === === === === === === === === === === === === == -->
<!-- Placed at the end of the document so the pages load faster -->

@ -1,3 +1,22 @@
<%
/*
* Copyright (c) 2015, 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.
*/
%>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

@ -17,7 +17,6 @@
*/
//Init js to execute
var logger = new Log();
logger.debug("running debug");
var app_TENANT_CONFIGS = 'tenant.configs';
var app_carbon = require('carbon');
var app_configs = {

@ -2,6 +2,18 @@
"welcomeFiles": ["pages/dashboard.jag"],
"initScripts": ["/init.js"],
"urlMappings": [
{
"url": "/login",
"path": "/controller/login.jag"
},
{
"url": "/logout",
"path": "/controller/logout.jag"
},
{
"url": "/acs",
"path": "/controller/acs.jag"
},
{
"url": "/devices/*",
"path": "/pages/device.jag"

@ -0,0 +1,37 @@
/*
* Copyright (c) 2015, 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.
*/
var config = function () {
var conf = application.get("PINCH_CONFIG");
if (!conf) {
var pinch = require('/modules/pinch.min.js').pinch,
server = require('carbon').server;
config = require('/config/config.json'),
pinch(config, /^/, function (path, key, value) {
if ((typeof value === 'string') && value.indexOf('%https.ip%') > -1) {
return value.replace('%https.ip%', server.address("https"));
} else if ((typeof value === 'string') && value.indexOf('%http.ip%') > -1) {
return value.replace('%http.ip%', server.address("http"));
}
return value;
});
application.put("PINCH_CONFIG", config);
conf = config;
}
return conf;
};

@ -0,0 +1,22 @@
/*
* *
* * Copyright (c) 2005-2014, 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.
*
*/
(function(){var k=function(a,c){return a.length!==c.length?!1:a.every(function(a,b){return c[b]===a})},j=function(a,c,d){var b,e;if("[object Array]"===Object.prototype.toString.call(a)){b=0;for(e=a.length;b<e;b++)c.apply(d,[b,a[b],a])}else for(b in a)a.hasOwnProperty(b)&&c.apply(d,[b,a[b],a])},h=function(a){for(var c=[],d=!1,b=0,e=a.length,f="",g=function(){f&&(c.push(f),f="")};b<e;b++)a[b].match(/\[|\]/)?(g(),d="]"===a[b]?!1:!0):'"'!==a[b]&&"'"!==a[b]&&("."===a[b]&&!d?g():f+=a[b]),b===e-1&&g();return c},
g=function(a,c,d){var b=-1!==["string","object"].indexOf(typeof a),e="string"===typeof c||c&&c.test&&c.exec,f=-1!==["string","object","function"].indexOf(typeof d);b&&e&&f&&("string"===typeof a?(this.instance=JSON.parse(a),this.json=!0):this.instance=a,this.pattern="string"===typeof c?c.replace(/'/g,'"'):c,this.replacement=d,this.createIndex(this.instance))};g.prototype.createIndex=function(a,c){var d=this;this.index=this.index||[];c=c||"";j(a,function(a,e){var f,a=a+"";f=a.match(/^[a-zA-Z]+$/)?c?
c+"."+a:a:a.match(/\d+/)?c+"["+a+"]":c+'["'+a+'"]';d.index.push(f);"object"===typeof e&&d.createIndex(e,f)})};g.prototype.replace=function(){var a=this;j(this.index,function(c,d){if(a.pattern&&a.pattern.test&&a.pattern.exec&&d.match(a.pattern))return a.replaceValue(d);if("string"===typeof a.pattern){var b=h(d),e=h(a.pattern);if(k(b,e))return a.replaceValue(d)}});return this.json?JSON.stringify(this.instance):this.instance};g.prototype.replaceValue=function(a){var c=this,d=h(a);d.reduce(function(b,
e,f){if(f===d.length-1)f="function"===typeof c.replacement?c.replacement(a,e,b[e]):c.replacement,b[e]=f;else return b[e]},this.instance)};var i=function(a,c,d,b){a=(new g(a,c,d)).replace();return"function"===typeof b?b(null,a):a};"undefined"!==typeof module&&module.exports?module.exports=i:"undefined"!==typeof define?define(function(){return i}):this.pinch=i})();

@ -49,9 +49,16 @@ var ssoMod = require("sso");
sso.sessionId = session.getId();
var referer = request.getHeader("referer");
sso.relayState = (referer ? referer : sso.relayState);
sso.relayState = sso.relayState + request.getQueryString(); // append query string
sso.relayState = sso.relayState;// append query string
var log = new Log();
if(request.getQueryString()){
sso.relayState += request.getQueryString();
}
sso.encodedSAMLAuthRequest = ssoMod.client.getEncodedSAMLAuthRequest(sso.issuer);
var postUrl = sso.address + sso.ssoService;
log.info(sso.relayState);
print("<div><p>You are now being redirected to SSO Provider. If the redirection fails, please click on the button below.</p> <form method='post' action='"+postUrl+"'><p><input type='hidden' name='SAMLRequest' value='"+sso.encodedSAMLAuthRequest+"'/><input type='hidden' name='RelayState' value='"+sso.relayState+"'/><input type='hidden' name='SSOAuthSessionID' value='"+sso.sessionId+"'/><button type='submit'>Redirect manually</button></p></form></div><script type = 'text/javascript' >document.forms[0].submit();</script>");
}
sso.logout = function(user){

@ -18,6 +18,7 @@
* under the License.
*/
var title="WSO2 CDM";
include("/includes/auth-header.jag");
%>
<html lang="en">
<%

@ -18,6 +18,7 @@
* under the License.
*/
var title="WSO2 CDM";
include("/includes/auth-header.jag");
%>
<html lang="en">
<%
@ -49,7 +50,7 @@ var title="WSO2 CDM";
var operation = operations[i]
%>
<button data-operation="<%=operation.featureName%>" class="device-operation btn btn-default">
<img src="/cdm/client/img/operations/lock.png" />
<img src="/cdm/client/img/operations/<%=operation.featureName%>.png" />
<p><%=operation.featureDescription %></p>
</button>
<%
@ -76,13 +77,7 @@ var title="WSO2 CDM";
%>
</div>
</div>
<div class="row">
<div class="col-md-12 well well-lg device-static-data">
<p>Model: <span>GT-I9500</span> </p>
<p>IMSI : <span>GT-I9500</span> </p>
<p>IMEI : <span>GT-I9500</span> </p>
</div>
</div>
<div class="row">
<div class="col-md-12 well well-lg device-static-data">
<table id="table-pagination" data-toggle="table" data-url="/cdm/data3.json" data-query-params="queryParams" data-height="300" data-pagination="true" data-search="true">

@ -305,6 +305,9 @@
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.identity.mgt.feature:${carbon.platform.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon:org.wso2.carbon.claim.mgt.server.feature:${carbon.platform.version}
</featureArtifactDef>
<!-- End of SSO Fixes -->
</featureArtifacts>
@ -586,7 +589,10 @@
<id>org.wso2.carbon.identity.mgt.feature.group</id>
<version>${carbon.platform.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.claim.mgt.server.feature.group</id>
<version>${carbon.platform.version}</version>
</feature>
<!--SSO FIX OVER-->
</features>

Loading…
Cancel
Save