revert-70aa11f8
thusithakalugamage 8 years ago
commit fa3db47400

@ -12,6 +12,7 @@
"iOSConfigRoot" : "%https.ip%/ios-enrollment/", "iOSConfigRoot" : "%https.ip%/ios-enrollment/",
"iOSAPIRoot" : "%https.ip%/ios/", "iOSAPIRoot" : "%https.ip%/ios/",
"adminService": "%https.ip%", "adminService": "%https.ip%",
"apimgt-gateway": false,
"oauthProvider": { "oauthProvider": {
"appRegistration": { "appRegistration": {
"appType": "webapp", "appType": "webapp",

@ -142,26 +142,35 @@ var handlers = function () {
"client credentials to session context as the server is unable to obtain " + "client credentials to session context as the server is unable to obtain " +
"dynamic client credentials - setUpEncodedTenantBasedClientAppCredentials(x)"); "dynamic client credentials - setUpEncodedTenantBasedClientAppCredentials(x)");
} else { } else {
var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials); if (devicemgtProps["apimgt-gateway"]) {
if (!jwtToken) { var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials);
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " + if (!jwtToken) {
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " +
"client credentials to session context as the server is unable to obtain " + "client credentials to session context as the server is unable to obtain " +
"a jwt token - setUpEncodedTenantBasedClientAppCredentials(x)"); "a jwt token - setUpEncodedTenantBasedClientAppCredentials(x)");
} else {
var tenantBasedClientAppCredentials = tokenUtil.
getTenantBasedClientAppCredentials(username, jwtToken);
if (!tenantBasedClientAppCredentials) {
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant " +
"based client credentials to session context as the server is unable " +
"to obtain such credentials - setUpEncodedTenantBasedClientAppCredentials(x)");
} else { } else {
var encodedTenantBasedClientAppCredentials = var tenantBasedClientAppCredentials = tokenUtil.
tokenUtil.encode(tenantBasedClientAppCredentials["clientId"] + ":" + getTenantBasedClientAppCredentials(username, jwtToken);
if (!tenantBasedClientAppCredentials) {
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant " +
"based client credentials to session context as the server is unable " +
"to obtain such credentials - setUpEncodedTenantBasedClientAppCredentials(x)");
} else {
var encodedTenantBasedClientAppCredentials =
tokenUtil.encode(tenantBasedClientAppCredentials["clientId"] + ":" +
tenantBasedClientAppCredentials["clientSecret"]); tenantBasedClientAppCredentials["clientSecret"]);
// setting up encoded tenant based client credentials to session context. // setting up encoded tenant based client credentials to session context.
session.put(constants["ENCODED_TENANT_BASED_CLIENT_APP_CREDENTIALS"], session.put(constants["ENCODED_TENANT_BASED_CLIENT_APP_CREDENTIALS"],
encodedTenantBasedClientAppCredentials); encodedTenantBasedClientAppCredentials);
}
} }
} else {
var encodedTenantBasedClientAppCredentials =
tokenUtil.encode(dynamicClientAppCredentials["clientId"] + ":" +
dynamicClientAppCredentials["clientSecret"]);
// setting up encoded tenant based client credentials to session context.
session.put(constants["ENCODED_TENANT_BASED_CLIENT_APP_CREDENTIALS"],
encodedTenantBasedClientAppCredentials);
} }
} }
} }

@ -1,6 +1,4 @@
{{unit "mdm.unit.lib.leaflet"}}
{{unit "cdmf.unit.lib.qrcode"}} {{unit "cdmf.unit.lib.qrcode"}}
{{unit "mdm.unit.device.qr-modal"}}
{{#zone "content"}} {{#zone "content"}}
{{#if deviceFound}} {{#if deviceFound}}

@ -53,6 +53,7 @@
<RecurrentTimes>1</RecurrentTimes> <RecurrentTimes>1</RecurrentTimes>
<Platforms> <Platforms>
<platform>android</platform> <platform>android</platform>
<platform>ios</platform>
</Platforms> </Platforms>
</Operation> </Operation>
<Operation> <Operation>
@ -60,6 +61,7 @@
<RecurrentTimes>5</RecurrentTimes> <RecurrentTimes>5</RecurrentTimes>
<Platforms> <Platforms>
<platform>android</platform> <platform>android</platform>
<platform>ios</platform>
</Platforms> </Platforms>
</Operation> </Operation>
<Operation> <Operation>
@ -67,6 +69,7 @@
<RecurrentTimes>1</RecurrentTimes> <RecurrentTimes>1</RecurrentTimes>
<Platforms> <Platforms>
<platform>android</platform> <platform>android</platform>
<platform>ios</platform>
</Platforms> </Platforms>
</Operation> </Operation>
</Operations> </Operations>

Loading…
Cancel
Save