Fix the AAF login 97/114197/1
authorsebdet <sebastien.determe@intl.att.com>
Fri, 23 Oct 2020 11:28:25 +0000 (13:28 +0200)
committersebdet <sebastien.determe@intl.att.com>
Fri, 23 Oct 2020 11:28:25 +0000 (13:28 +0200)
Current code does not check the right Principal class name

Issue-ID: CLAMP-956
Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Change-Id: Ia69c68c7dfa69ce385ff2844e557fed722ae1bb6

src/main/java/org/onap/clamp/clds/ClampServlet.java

index c199727..6adb76c 100644 (file)
@@ -113,7 +113,7 @@ public class ClampServlet extends CamelHttpTransportServlet {
     protected void doService(HttpServletRequest request, HttpServletResponse response) {
         Principal principal = request.getUserPrincipal();
         if (principal != null && Arrays.stream(loadDynamicAuthenticationClasses())
-                .anyMatch(className -> className.equals(principal.getName()))) {
+                .anyMatch(className -> className.equals(principal.getClass().getName()))) {
             // When AAF is enabled, there is a need to provision the permissions to Spring
             // system
             List<GrantedAuthority> grantedAuths = new ArrayList<>();