Skip to content

Commit fecc6b6

Browse files
SAML2LoginAPIAuthenticatorCmd: Don't support HTTP artifact binding
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 394e613 commit fecc6b6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/user-authenticators/saml2/src/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public Response processSAMLResponse(String responseMessage) {
162162
@Override
163163
public String authenticate(final String command, final Map<String, Object[]> params, final HttpSession session, final String remoteAddress, final String responseType, final StringBuilder auditTrailSb, final HttpServletResponse resp) throws ServerApiException {
164164
try {
165-
if (!params.containsKey("SAMLResponse")) {
165+
if (!params.containsKey("SAMLResponse") && !params.containsKey("SAMLart")) {
166166
String idpUrl = null;
167167
final String[] idps = (String[])params.get(ApiConstants.IDP_URL);
168168
if (idps != null && idps.length > 0) {
@@ -171,6 +171,10 @@ public String authenticate(final String command, final Map<String, Object[]> par
171171
String redirectUrl = this.buildAuthnRequestUrl(idpUrl);
172172
resp.sendRedirect(redirectUrl);
173173
return "";
174+
} if (params.containsKey("SAMLart")) {
175+
throw new ServerApiException(ApiErrorCode.UNSUPPORTED_ACTION_ERROR, _apiServer.getSerializedApiError(ApiErrorCode.UNSUPPORTED_ACTION_ERROR.getHttpCode(),
176+
"SAML2 HTTP Artifact Binding is not supported",
177+
params, responseType));
174178
} else {
175179
final String samlResponse = ((String[])params.get(SAMLUtils.SAML_RESPONSE))[0];
176180
Response processedSAMLResponse = this.processSAMLResponse(samlResponse);

0 commit comments

Comments
 (0)