From 3021947f3079e50d006bb1a612ba1eaaaad5d9ee Mon Sep 17 00:00:00 2001 From: ayyoob Date: Wed, 25 Jan 2017 14:03:57 +0530 Subject: [PATCH] updated saml grant type config name --- .../analytics-view.js | 2 +- .../jaggeryapps/android-web-agent/app/conf/config.json | 5 +++-- .../app/modules/oauth/token-handler-utils.js | 4 ++-- .../jaggeryapps/windows-web-agent/app/conf/config.json | 5 +++-- .../app/modules/oauth/token-handler-utils.js | 4 ++-- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js index e54cef4ec4..ec1cf20ad0 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.realtime.analytics-view/analytics-view.js @@ -41,4 +41,4 @@ function onRequest(context) { response.addCookie(websocketToken); } return {"device": device, "websocketEndpoint": websocketEndpoint}; -} \ No newline at end of file +} diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json index 85b4a90bd8..52de8d0213 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/conf/config.json @@ -12,9 +12,10 @@ "owner": "admin@carbon.super", "dynamicClientAppRegistrationServiceURL": "%https.ip%/dynamic-client-web/register", "apiManagerClientAppRegistrationServiceURL": "%https.ip%/api-application-registration/register/tenants", - "grantType": "password refresh_token urn:ietf:params:oauth:grant-type:saml2-carbon", + "grantType": "password refresh_token urn:ietf:carbon:signed:grant-type:saml2-bearer", "tokenScope": "admin", - "callbackUrl": "%https.ip%/api/device-mgt/v1.0" + "callbackUrl": "%https.ip%/api/device-mgt/v1.0", + "samlGrantTypeName": "urn:ietf:carbon:signed:grant-type:saml2-bearer" }, "tokenServiceURL": "%https.ip%/oauth2/token" }, diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/oauth/token-handler-utils.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/oauth/token-handler-utils.js index 0bfd5c4b44..614e79bb86 100755 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/oauth/token-handler-utils.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/android-web-agent/app/modules/oauth/token-handler-utils.js @@ -214,8 +214,8 @@ var utils = function () { // calling oauth provider token service endpoint var requestURL = deviceMgtProps["oauthProvider"]["tokenServiceURL"]; - var requestPayload = "grant_type=urn:ietf:params:oauth:grant-type:saml2-carbon&" + - "assertion=" + encodeURIComponent(encodedAssertion) + "&scope=" + scopes; + var requestPayload = "grant_type=" + + deviceMgtProps["oauthProvider"]["appRegistration"]["samlGrantTypeName"] + + "&" + "assertion=" + encodeURIComponent(encodedAssertion) + "&scope=" + scopes; var xhr = new XMLHttpRequest(); xhr.open("POST", requestURL, false); diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json index 088cfa09c5..fedbb485e6 100755 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/conf/config.json @@ -11,9 +11,10 @@ "owner": "admin@carbon.super", "dynamicClientAppRegistrationServiceURL": "%https.ip%/dynamic-client-web/register", "apiManagerClientAppRegistrationServiceURL": "%https.ip%/api-application-registration/register/tenants", - "grantType": "password refresh_token urn:ietf:params:oauth:grant-type:saml2-carbon", + "grantType": "password refresh_token urn:ietf:carbon:signed:grant-type:saml2-bearer", "tokenScope": "admin", - "callbackUrl": "%https.ip%/api/device-mgt/v1.0" + "callbackUrl": "%https.ip%/api/device-mgt/v1.0", + "samlGrantTypeName": "urn:ietf:carbon:signed:grant-type:saml2-bearer" }, "tokenServiceURL": "%https.ip%/oauth2/token" }, diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js index 0bfd5c4b44..e6d4a41df8 100755 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.ui/src/main/resources/jaggeryapps/windows-web-agent/app/modules/oauth/token-handler-utils.js @@ -214,8 +214,8 @@ var utils = function () { // calling oauth provider token service endpoint var requestURL = deviceMgtProps["oauthProvider"]["tokenServiceURL"]; - var requestPayload = "grant_type=urn:ietf:params:oauth:grant-type:saml2-carbon&" + - "assertion=" + encodeURIComponent(encodedAssertion) + "&scope=" + scopes; + var requestPayload = "grant_type=" + deviceMgtProps["oauthProvider"]["appRegistration"]["samlGrantTypeName"] + + "&" + "assertion=" + encodeURIComponent(encodedAssertion) + "&scope=" + scopes; var xhr = new XMLHttpRequest(); xhr.open("POST", requestURL, false);