Release oam-ves-adopter Contatiner
[oam/nf-oam-adopter.git] / ves-nf-oam-adopter / ves-nf-oam-adopter-app / src / main / java / org / o / ran / oam / nf / oam / adopter / app / config / LoginAttemptsLogger.java
index e1222f5..0389b6a 100644 (file)
@@ -40,12 +40,16 @@ public class LoginAttemptsLogger {
     public void auditEventHappened(final AuditApplicationEvent auditApplicationEvent) {
         final AuditEvent auditEvent = auditApplicationEvent.getAuditEvent();
         final WebAuthenticationDetails details = (WebAuthenticationDetails) auditEvent.getData().get("details");
+        if (details == null) {
+            LOG.info("AUDIT: User: {} Event Type: {}", auditEvent.getPrincipal(), auditEvent.getType());
+            return;
+        }
         LOG.info("AUDIT: User: {} Event Type: {} Remote IP address: {}",
                 auditEvent.getPrincipal(), auditEvent.getType(), details.getRemoteAddress());
     }
 
     @Bean
-    public InMemoryAuditEventRepository auditEventRepository() throws Exception {
+    public InMemoryAuditEventRepository auditEventRepository() {
         return new InMemoryAuditEventRepository();
     }
 }