cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] rafaelweingartner commented on a change in pull request #2185: CLOUDSTACK-9976: Redirect saml2 failed login message to a configurable URL
Date Mon, 01 Oct 2018 16:41:34 GMT
rafaelweingartner commented on a change in pull request #2185: CLOUDSTACK-9976: Redirect saml2
failed login message to a configurable URL
URL: https://github.com/apache/cloudstack/pull/2185#discussion_r221677314
 
 

 ##########
 File path: plugins/user-authenticators/saml2/src/main/java/org/apache/cloudstack/api/command/SAML2LoginAPIAuthenticatorCmd.java
 ##########
 @@ -329,6 +333,24 @@ public String authenticate(final String command, final Map<String,
Object[]> par
                 params, responseType));
     }
 
+    /**
+     * If it fails to authenticate the user, the method gets the value from configuration
+     * Saml2FailedLoginRedirectUrl; if the user configured an error URL then it redirects
to that
+     * URL, otherwise it throws the ServerApiException
+     */
+    protected void whenFailToAuthenticateThrowExceptionOrRedirectToUrl(final Map<String,
Object[]> params, final String responseType, final HttpServletResponse resp, Issuer issuer,
+            UserAccount userAccount) throws IOException {
+        if (userAccount == null || userAccount.getExternalEntity() == null || !_samlAuthManager.isUserAuthorized(userAccount.getId(),
issuer.getValue())) {
+            String saml2FailedLoginRedirectUrl = (String)getConfigKeys()[0].value();
 
 Review comment:
   What about using `Saml2FailedLoginRedirectUrl.value()` instead of `getConfigKeys()[0].value()`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message