Skip to content

Commit 9220ffc

Browse files
test_accounts.py failure fix - fallback using the camelCase parameter name "domainId" (as earlier)
1 parent d054344 commit 9220ffc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

plugins/user-authenticators/oauth2/src/main/java/org/apache/cloudstack/oauth2/api/command/OauthLoginAPIAuthenticatorCmd.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ private String doOauthAuthentication(HttpSession session, Long domainId, String
177177

178178
protected Long getDomainIdFromParams(Map<String, Object[]> params, StringBuilder auditTrailSb, String responseType) {
179179
String[] domainIdArr = (String[])params.get(ApiConstants.DOMAIN_ID);
180+
if (domainIdArr == null) {
181+
// Fallback to support clients using the camelCase parameter name "domainId"
182+
domainIdArr = (String[])params.get(ApiConstants.DOMAIN__ID);
183+
}
180184
Long domainId = null;
181185
if (domainIdArr != null && domainIdArr.length > 0) {
182186
try {

server/src/main/java/com/cloud/api/auth/DefaultLoginAPIAuthenticatorCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ public String authenticate(String command, Map<String, Object[]> params, HttpSes
110110
// FIXME: ported from ApiServlet, refactor and cleanup
111111
final String[] username = (String[])params.get(ApiConstants.USERNAME);
112112
final String[] password = (String[])params.get(ApiConstants.PASSWORD);
113-
final String[] domainIdArr = (String[])params.get(ApiConstants.DOMAIN_ID);
113+
String[] domainIdArr = (String[])params.get(ApiConstants.DOMAIN_ID);
114+
if (domainIdArr == null) {
115+
// Fallback to support clients using the camelCase parameter name "domainId"
116+
domainIdArr = (String[])params.get(ApiConstants.DOMAIN__ID);
117+
}
114118
Long domainId = null;
115119
if (domainIdArr != null && domainIdArr.length > 0) {
116120
try {

0 commit comments

Comments
 (0)