|
|
@ -160,26 +160,6 @@ public class KeyMgtServiceImpl implements KeyMgtService {
|
|
|
|
|
|
|
|
|
|
|
|
String tenantDomain = MultitenantUtils.getTenantDomain(application.getOwner());
|
|
|
|
String tenantDomain = MultitenantUtils.getTenantDomain(application.getOwner());
|
|
|
|
|
|
|
|
|
|
|
|
// String username, password;
|
|
|
|
|
|
|
|
// if (KeyMgtConstants.SUPER_TENANT.equals(tenantDomain)) {
|
|
|
|
|
|
|
|
// kmConfig = getKeyManagerConfig();
|
|
|
|
|
|
|
|
// username = kmConfig.getAdminUsername();
|
|
|
|
|
|
|
|
// password = kmConfig.getAdminPassword();
|
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// try {
|
|
|
|
|
|
|
|
// username = getRealmService()
|
|
|
|
|
|
|
|
// .getTenantUserRealm(-1234).getRealmConfiguration()
|
|
|
|
|
|
|
|
// .getRealmProperty("reserved_tenant_user_username") + "@" + tenantDomain;
|
|
|
|
|
|
|
|
// password = getRealmService()
|
|
|
|
|
|
|
|
// .getTenantUserRealm(-1234).getRealmConfiguration()
|
|
|
|
|
|
|
|
// .getRealmProperty("reserved_tenant_user_password");
|
|
|
|
|
|
|
|
// } catch (UserStoreException e) {
|
|
|
|
|
|
|
|
// msg = "Error while loading user realm configuration";
|
|
|
|
|
|
|
|
// log.error(msg);
|
|
|
|
|
|
|
|
// throw new KeyMgtException(msg);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RequestBody appTokenPayload;
|
|
|
|
RequestBody appTokenPayload;
|
|
|
|
switch (tokenRequest.getGrantType()) {
|
|
|
|
switch (tokenRequest.getGrantType()) {
|
|
|
|
case "client_credentials":
|
|
|
|
case "client_credentials":
|
|
|
@ -197,8 +177,7 @@ public class KeyMgtServiceImpl implements KeyMgtService {
|
|
|
|
case "refresh_token":
|
|
|
|
case "refresh_token":
|
|
|
|
appTokenPayload = new FormBody.Builder()
|
|
|
|
appTokenPayload = new FormBody.Builder()
|
|
|
|
.add("grant_type", "refresh_token")
|
|
|
|
.add("grant_type", "refresh_token")
|
|
|
|
.add("refresh_token", tokenRequest.getRefreshToken())
|
|
|
|
.add("refresh_token", tokenRequest.getRefreshToken()).build();
|
|
|
|
.add("scope", tokenRequest.getScope()).build();
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "urn:ietf:params:oauth:grant-type:jwt-bearer":
|
|
|
|
case "urn:ietf:params:oauth:grant-type:jwt-bearer":
|
|
|
|
appTokenPayload = new FormBody.Builder()
|
|
|
|
appTokenPayload = new FormBody.Builder()
|
|
|
|