ahgittin commented on a change in pull request #1180:
URL: https://github.com/apache/brooklyn-server/pull/1180#discussion_r644866590



##########
File path: 
rest/rest-resources/src/main/java/org/apache/brooklyn/rest/filter/BrooklynSecurityProviderFilterJersey.java
##########
@@ -71,6 +74,11 @@ public void filter(ContainerRequestContext requestContext) 
throws IOException {
                     rin = 
Response.status(Status.UNAUTHORIZED).entity("Authentication is 
required").build();
                 }
             }
+            if (rin.getStatus()==Status.UNAUTHORIZED.getStatusCode() &&
+                    
Strings.isNonBlank(mgmt.getConfig().getConfig(BrooklynSecurityProviderFilterJavax.LOGIN_FORM)))
 {
+                rin = 
Response.status(Status.UNAUTHORIZED).entity("Authentication is 
required").header(LOGIN_PAGE_HEADER, 
mgmt.getConfig().getConfig(BrooklynSecurityProviderFilterJavax.LOGIN_FORM)).build();

Review comment:
       maybe cleaner if we make `rin` the `ResponseBuilder` and `build()` it 
when we return?  though the builder API might not support that.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to