|
|
@ -142,6 +142,7 @@ 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 {
|
|
|
|
|
|
|
|
if (devicemgtProps["apimgt-gateway"]) {
|
|
|
|
var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials);
|
|
|
|
var jwtToken = tokenUtil.getAccessTokenByJWTGrantType(dynamicClientAppCredentials);
|
|
|
|
if (!jwtToken) {
|
|
|
|
if (!jwtToken) {
|
|
|
|
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " +
|
|
|
|
throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up encoded tenant based " +
|
|
|
@ -163,6 +164,14 @@ var handlers = function () {
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|