mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
IOTS-340: Fixing consumer key and consumer secret is null on api-mgt-ext
This commit is contained in:
parent
84918f58c7
commit
a633547d19
@ -75,16 +75,9 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|||||||
"Api application creation failed for " + applicationName + " to the user " + username);
|
"Api application creation failed for " + applicationName + " to the user " + username);
|
||||||
}
|
}
|
||||||
|
|
||||||
APIKey retrievedApiApplicationKey = null;
|
OAuthApplicationInfo oAuthApp = application.getOAuthApp(keyType);
|
||||||
for (APIKey apiKey : application.getKeys()) {
|
if (oAuthApp != null) {
|
||||||
String applicationKeyType = apiKey.getType();
|
if (oAuthApp.getClientId().equals(clientId)) {
|
||||||
if (applicationKeyType != null && applicationKeyType.equals(keyType)) {
|
|
||||||
retrievedApiApplicationKey = apiKey;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (retrievedApiApplicationKey != null) {
|
|
||||||
if (retrievedApiApplicationKey.getConsumerKey().equals(clientId)) {
|
|
||||||
if (tags != null && tags.length > 0) {
|
if (tags != null && tags.length > 0) {
|
||||||
createApplicationAndSubscribeToAPIs(applicationName, tags, username);
|
createApplicationAndSubscribeToAPIs(applicationName, tags, username);
|
||||||
}
|
}
|
||||||
@ -152,18 +145,11 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe
|
|||||||
"Api application creation failed for " + apiApplicationName + " to the user " + username);
|
"Api application creation failed for " + apiApplicationName + " to the user " + username);
|
||||||
}
|
}
|
||||||
|
|
||||||
APIKey retrievedApiApplicationKey = null;
|
OAuthApplicationInfo oAuthApp = application.getOAuthApp(keyType);
|
||||||
for (APIKey apiKey : application.getKeys()) {
|
if (oAuthApp != null) {
|
||||||
String applicationKeyType = apiKey.getType();
|
|
||||||
if (applicationKeyType != null && applicationKeyType.equals(keyType)) {
|
|
||||||
retrievedApiApplicationKey = apiKey;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (retrievedApiApplicationKey != null) {
|
|
||||||
ApiApplicationKey apiApplicationKey = new ApiApplicationKey();
|
ApiApplicationKey apiApplicationKey = new ApiApplicationKey();
|
||||||
apiApplicationKey.setConsumerKey(retrievedApiApplicationKey.getConsumerKey());
|
apiApplicationKey.setConsumerKey(oAuthApp.getClientId());
|
||||||
apiApplicationKey.setConsumerSecret(retrievedApiApplicationKey.getConsumerSecret());
|
apiApplicationKey.setConsumerSecret(oAuthApp.getClientSecret());
|
||||||
return apiApplicationKey;
|
return apiApplicationKey;
|
||||||
}
|
}
|
||||||
String[] allowedDomains = new String[1];
|
String[] allowedDomains = new String[1];
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user