Merge branch 'master' of https://gitlab.com/entgra/carbon-device-mgt into upstream-master

revert-70ac1926
Pahansith 4 years ago
commit a36733d224

@ -50,7 +50,7 @@ public final class DeviceManagementConstants {
private ConfigurationManagement(){ private ConfigurationManagement(){
throw new AssertionError(); throw new AssertionError();
} }
public static final String SCOPES_FOR_TOKEN = "perm:device:operations perm:device:publish-event"; public static final String SCOPES_FOR_TOKEN = "perm:device:operations perm:device:publish-event perm:windows:enroll";
public static final String IOT_GATEWAY_HOST = "iot.gateway.host"; public static final String IOT_GATEWAY_HOST = "iot.gateway.host";
public static final String IOT_GATEWAY_HTTPS_PORT = "iot.gateway.https.port"; public static final String IOT_GATEWAY_HTTPS_PORT = "iot.gateway.https.port";
public static final String APPLICATION_REGISTRATION_API_ENDPOINT = public static final String APPLICATION_REGISTRATION_API_ENDPOINT =

@ -812,6 +812,7 @@ public final class DeviceManagerUtil {
applicationRegistration.setApplicationName("MyApp"); applicationRegistration.setApplicationName("MyApp");
applicationRegistration.setAllowedToAllDomains(false); applicationRegistration.setAllowedToAllDomains(false);
List<String> tags = new ArrayList<>(); List<String> tags = new ArrayList<>();
tags.add("windows");
tags.add("device_management"); tags.add("device_management");
applicationRegistration.setTags(tags); applicationRegistration.setTags(tags);
applicationRegistration.setValidityPeriod(3600); applicationRegistration.setValidityPeriod(3600);

@ -228,8 +228,14 @@ public class SsoLoginHandler extends HttpServlet {
*/ */
private StringEntity constructAppGrantTypeUpdatePayload() { private StringEntity constructAppGrantTypeUpdatePayload() {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("supportedGrantTypes", new JSONArray(new Object[]{HandlerConstants.CODE_GRANT_TYPE, jsonObject.put("supportedGrantTypes",
HandlerConstants.REFRESH_TOKEN_GRANT_TYPE, HandlerConstants.PASSWORD_GRANT_TYPE})); new JSONArray(new Object[]{
HandlerConstants.CODE_GRANT_TYPE,
HandlerConstants.REFRESH_TOKEN_GRANT_TYPE,
HandlerConstants.PASSWORD_GRANT_TYPE,
HandlerConstants.JWT_BEARER_GRANT_TYPE
})
);
jsonObject.put(HandlerConstants.CALLBACK_URL_KEY, iotsCoreUrl + baseContextPath + HandlerConstants.SSO_LOGIN_CALLBACK); jsonObject.put(HandlerConstants.CALLBACK_URL_KEY, iotsCoreUrl + baseContextPath + HandlerConstants.SSO_LOGIN_CALLBACK);
String payload = jsonObject.toString(); String payload = jsonObject.toString();
return new StringEntity(payload, ContentType.APPLICATION_JSON); return new StringEntity(payload, ContentType.APPLICATION_JSON);

@ -52,6 +52,7 @@ public class HandlerConstants {
public static final String CODE_GRANT_TYPE = "authorization_code"; public static final String CODE_GRANT_TYPE = "authorization_code";
public static final String REFRESH_TOKEN_GRANT_TYPE = "refresh_token"; public static final String REFRESH_TOKEN_GRANT_TYPE = "refresh_token";
public static final String PASSWORD_GRANT_TYPE = "password"; public static final String PASSWORD_GRANT_TYPE = "password";
public static final String JWT_BEARER_GRANT_TYPE = "urn:ietf:params:oauth:grant-type:jwt-bearer";
public static final String SCHEME_SEPARATOR = "://"; public static final String SCHEME_SEPARATOR = "://";
public static final String COLON = ":"; public static final String COLON = ":";

Loading…
Cancel
Save