jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.55k stars 4.03k forks source link

Google Login with Keycloak failing #6923

Closed rakeshkalra1983 closed 6 years ago

rakeshkalra1983 commented 6 years ago
Overview of the issue

Login with Google is failing when Jhipster app is created with OpenID Connect (Keycloak) and enabling Google as Identity Provider in Keycloak.

Exception In logs:

2017-12-30 18:07:33.550 DEBUG 70390 --- [  XNIO-2 task-9] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@11cd6b1b8 pairs: {null: HTTP/1.1 200 OK}{Connection: keep-alive}{Cache-Control: no-cache}{X-Powered-By: Undertow/1}{Server: WildFly/11}{Content-Type: application/json}{Content-Length: 246}{Date: Sat, 30 Dec 2017 12:37:30 GMT}
2017-12-30 18:07:33.556 DEBUG 70390 --- [  XNIO-2 task-9] com.fya.aop.logging.LoggingAspect        : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Sat Dec 30 18:07:33 IST 2017, principal=Rakesh Kalra, type=AUTHENTICATION_SUCCESS, data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=<SESSION>, tokenType=bearertokenValue=<TOKEN>}]]
2017-12-30 18:07:33.613 DEBUG 70390 --- [  XNIO-2 task-9] com.fya.aop.logging.LoggingAspect        : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2017-12-30 18:07:33.615 DEBUG 70390 --- [  XNIO-2 task-9] c.f.s.OAuth2AuthenticationSuccessHandler : Redirecting to saved login origin URI: http://localhost:9000/
2017-12-30 18:07:34.722 DEBUG 70390 --- [ XNIO-2 task-10] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with argument[s] = []
2017-12-30 18:07:34.722 DEBUG 70390 --- [ XNIO-2 task-10] com.fya.aop.logging.LoggingAspect        : Exit: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with result = com.fya.web.rest.ProfileInfoResource$ProfileInfoVM@28ca2cdc
2017-12-30 18:07:34.764 DEBUG 70390 --- [ XNIO-2 task-11] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.web.rest.AccountResource.getAccount() with argument[s] = [org.springframework.security.oauth2.provider.OAuth2Authentication@12e17699: Principal: Rakesh Kalra; Credentials: [PROTECTED]; Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1, sessionId=<SESSION>, tokenType=bearertokenValue=<TOKEN>; Granted Authorities: ROLE_USER]
2017-12-30 18:07:34.768 DEBUG 70390 --- [ XNIO-2 task-11] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.service.UserService.getUserFromAuthentication() with argument[s] = [org.springframework.security.oauth2.provider.OAuth2Authentication@12e17699: Principal: Rakesh Kalra; Credentials: [PROTECTED]; Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1, sessionId=<SESSION>, tokenType=bearertokenValue=<TOKEN>; Granted Authorities: ROLE_USER]
2017-12-30 18:07:34.821 DEBUG 70390 --- [ XNIO-2 task-11] com.fya.service.UserService              : Saving user 'rakesh.kalra1983@gmail.com' in local database...
2017-12-30 18:07:34.905 ERROR 70390 --- [ XNIO-2 task-11] com.fya.aop.logging.LoggingAspect        : Exception in com.fya.service.UserService.getUserFromAuthentication() with cause = 'NULL' and exception = 'null'

javax.validation.ConstraintViolationException: null
        at org.springframework.data.mongodb.core.mapping.event.ValidatingMongoEventListener.onBeforeSave(ValidatingMongoEventListener.java:67)
        at org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener.onApplicationEvent(AbstractMongoEventListener.java:88)
        at org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener.onApplicationEvent(AbstractMongoEventListener.java:31)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)

(I am pasting complete stack trace in next comment, for reference)

Motivation for or Use Case

Trying to achieve social login with Jhipster and Keycloak.

Reproduce the error

To reproduce the error:

JHipster Version(s)

4.13.1

JHipster configuration

{ "generator-jhipster": { "promptValues": { "packageName": "com.fya" }, "jhipsterVersion": "4.13.1", "baseName": "fya", "packageName": "com.fya", "packageFolder": "com/fya", "serverPort": "8080", "authenticationType": "oauth2", "cacheProvider": "ehcache", "enableHibernateCache": false, "clusteredHttpSession": false, "websocket": false, "databaseType": "mongodb", "devDatabaseType": "mongodb", "prodDatabaseType": "mongodb", "searchEngine": false, "messageBroker": false, "serviceDiscoveryType": false, "buildTool": "maven", "enableSocialSignIn": false, "enableSwaggerCodegen": false, "clientFramework": "angularX", "useSass": false, "clientPackageManager": "yarn", "applicationType": "monolith", "testFrameworks": [], "jhiPrefix": "jhi", "enableTranslation": false } }

Browsers and Operating System

Safari

rakeshkalra1983 commented 6 years ago

[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building Fya 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> spring-boot-maven-plugin:1.5.9.RELEASE:run (default-cli) > test-compile @ fya >>>
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (default-resources) @ fya ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 7 resources
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ fya ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 7 resources
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-versions) @ fya ---
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:copy-resources (docker-resources) @ fya ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 6 resources
[INFO] 
[INFO] --- jacoco-maven-plugin:0.7.9:prepare-agent (pre-unit-tests) @ fya ---
[INFO] argLine set to -javaagent:/Users/rakesh/.m2/repository/org/jacoco/org.jacoco.agent/0.7.9/org.jacoco.agent-0.7.9-runtime.jar=destfile=/Users/rakesh/coding/codebase/jhipster/projects/fya/target/test-results/coverage/jacoco/jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx256m
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ fya ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 68 source files to /Users/rakesh/coding/codebase/jhipster/projects/fya/target/classes
[INFO] /Users/rakesh/coding/codebase/jhipster/projects/fya/src/main/java/com/fya/service/UserService.java: /Users/rakesh/coding/codebase/jhipster/projects/fya/src/main/java/com/fya/service/UserService.java uses unchecked or unsafe operations.
[INFO] /Users/rakesh/coding/codebase/jhipster/projects/fya/src/main/java/com/fya/service/UserService.java: Recompile with -Xlint:unchecked for details.
[INFO] 
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ fya ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 2 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ fya ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] <<< spring-boot-maven-plugin:1.5.9.RELEASE:run (default-cli) < test-compile @ fya <<<
[INFO] 
[INFO] 
[INFO] --- spring-boot-maven-plugin:1.5.9.RELEASE:run (default-cli) @ fya ---
[INFO] Attaching agents: []
18:03:09.817 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Included patterns for restart : []
18:03:09.821 [main] DEBUG org.springframework.boot.devtools.settings.DevToolsSettings - Excluded patterns for restart : [/spring-boot-starter/target/classes/, /spring-boot-autoconfigure/target/classes/, /spring-boot-starter-[\w-]+/, /spring-boot/target/classes/, /spring-boot-actuator/target/classes/, /spring-boot-devtools/target/classes/]
18:03:09.821 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/Users/rakesh/coding/codebase/jhipster/projects/fya/target/classes/]

        ??? ???   ??? ????????? ????????   ??????? ????????? ????????? ????????
        ??? ???   ??? ????????? ????????? ???????? ????????? ????????? ?????????
        ??? ?????????    ???    ????????? ???????     ???    ???????   ?????????
  ???   ??? ?????????    ???    ????????   ???????    ???    ???????   ????????
  ????????? ???   ??? ????????? ???       ????????    ???    ????????? ???  ????
   ???????  ???   ??? ????????? ???       ???????     ???    ????????? ???   ???

:: JHipster ?  :: Running Spring Boot 1.5.9.RELEASE ::
:: http://www.jhipster.tech ::

2017-12-30 18:03:10.686  INFO 70390 --- [  restartedMain] com.fya.FyaApp                           : Starting FyaApp on macbook.lan with PID 70390 (/Users/rakesh/coding/codebase/jhipster/projects/fya/target/classes started by rakesh in /Users/rakesh/coding/codebase/jhipster/projects/fya)
2017-12-30 18:03:10.688 DEBUG 70390 --- [  restartedMain] com.fya.FyaApp                           : Running with Spring Boot v1.5.9.RELEASE, Spring v4.3.13.RELEASE
2017-12-30 18:03:10.688  INFO 70390 --- [  restartedMain] com.fya.FyaApp                           : The following profiles are active: swagger,dev
2017-12-30 18:03:10.993 DEBUG 70390 --- [kground-preinit] org.jboss.logging                        : Logging Provider: org.jboss.logging.Slf4jLoggerProvider found via system property
2017-12-30 18:03:13.461 DEBUG 70390 --- [  restartedMain] com.fya.config.AsyncConfiguration        : Creating Async Task Executor
2017-12-30 18:03:14.409 DEBUG 70390 --- [  restartedMain] c.ehcache.core.Ehcache-usersByLogin      : Initialize successful.
2017-12-30 18:03:14.428 DEBUG 70390 --- [  restartedMain] c.ehcache.core.Ehcache-usersByEmail      : Initialize successful.
2017-12-30 18:03:14.483 DEBUG 70390 --- [  restartedMain] com.fya.config.MetricsConfiguration      : Registering JVM gauges
2017-12-30 18:03:14.503 DEBUG 70390 --- [  restartedMain] com.fya.config.MetricsConfiguration      : Initializing Metrics JMX reporting
2017-12-30 18:03:15.498 DEBUG 70390 --- [  restartedMain] com.fya.config.WebConfigurer             : Registering CORS filter
2017-12-30 18:03:15.668  INFO 70390 --- [  restartedMain] com.fya.config.WebConfigurer             : Web application configuration, using profiles: swagger
2017-12-30 18:03:15.669 DEBUG 70390 --- [  restartedMain] com.fya.config.WebConfigurer             : Initializing Metrics registries
2017-12-30 18:03:15.672 DEBUG 70390 --- [  restartedMain] com.fya.config.WebConfigurer             : Registering Metrics Filter
2017-12-30 18:03:15.673 DEBUG 70390 --- [  restartedMain] com.fya.config.WebConfigurer             : Registering Metrics Servlet
2017-12-30 18:03:15.681  INFO 70390 --- [  restartedMain] com.fya.config.WebConfigurer             : Web application fully configured
2017-12-30 18:03:20.940 DEBUG 70390 --- [  restartedMain] com.fya.config.DatabaseConfiguration     : Configuring Mongobee
2017-12-30 18:03:20.991 DEBUG 70390 --- [  restartedMain] Mongobee dao                             : Index in collection dbchangelog was created
2017-12-30 18:03:21.017  INFO 70390 --- [  restartedMain] com.github.mongobee.Mongobee             : Mongobee acquired process lock, starting the data migration sequence..
2017-12-30 18:03:21.199  INFO 70390 --- [  restartedMain] com.github.mongobee.Mongobee             : Mongobee is releasing process lock.
2017-12-30 18:03:21.214  INFO 70390 --- [  restartedMain] com.github.mongobee.Mongobee             : Mongobee has finished his job.
2017-12-30 18:03:22.372 DEBUG 70390 --- [  restartedMain] i.g.j.c.apidoc.SwaggerConfiguration      : Starting Swagger
2017-12-30 18:03:22.379 DEBUG 70390 --- [  restartedMain] i.g.j.c.apidoc.SwaggerConfiguration      : Started Swagger in 7 ms
2017-12-30 18:03:23.927  INFO 70390 --- [  restartedMain] com.fya.FyaApp                           : Started FyaApp in 14.088 seconds (JVM running for 14.681)
2017-12-30 18:03:23.932  INFO 70390 --- [  restartedMain] com.fya.FyaApp                           : 
----------------------------------------------------------
        Application 'fya' is running! Access URLs:
        Local:          http://localhost:8080
        External:       http://192.168.86.250:8080
        Profile(s):     [swagger, dev]
----------------------------------------------------------
2017-12-30 18:03:32.035 DEBUG 70390 --- [  XNIO-2 task-1] com.fya.config.OAuth2Configuration$1     : Initializing filter 'oncePerRequestFilter'
2017-12-30 18:03:32.035 DEBUG 70390 --- [  XNIO-2 task-1] com.fya.config.OAuth2Configuration$1     : Filter 'oncePerRequestFilter' configured successfully
2017-12-30 18:03:32.095 DEBUG 70390 --- [  XNIO-2 task-2] com.fya.aop.logging.LoggingAspect        : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Sat Dec 30 18:03:32 IST 2017, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2017-12-30 18:03:32.096 DEBUG 70390 --- [  XNIO-2 task-2] com.fya.aop.logging.LoggingAspect        : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2017-12-30 18:03:32.111 DEBUG 70390 --- [  XNIO-2 task-1] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with argument[s] = []
2017-12-30 18:03:32.117 DEBUG 70390 --- [  XNIO-2 task-1] com.fya.aop.logging.LoggingAspect        : Exit: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with result = com.fya.web.rest.ProfileInfoResource$ProfileInfoVM@680c5d44
2017-12-30 18:03:32.128  WARN 70390 --- [  XNIO-2 task-2] o.z.p.spring.web.advice.AdviceTrait      : Unauthorized: Full authentication is required to access this resource
2017-12-30 18:03:32.261  WARN 70390 --- [  XNIO-2 task-2] .m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource
2017-12-30 18:03:49.478 DEBUG 70390 --- [  XNIO-2 task-3] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with argument[s] = []
2017-12-30 18:03:49.479 DEBUG 70390 --- [  XNIO-2 task-3] com.fya.aop.logging.LoggingAspect        : Exit: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with result = com.fya.web.rest.ProfileInfoResource$ProfileInfoVM@3b6829c2
2017-12-30 18:03:49.520 DEBUG 70390 --- [  XNIO-2 task-4] com.fya.aop.logging.LoggingAspect        : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Sat Dec 30 18:03:49 IST 2017, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2017-12-30 18:03:49.521 DEBUG 70390 --- [  XNIO-2 task-4] com.fya.aop.logging.LoggingAspect        : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2017-12-30 18:03:49.522  WARN 70390 --- [  XNIO-2 task-4] o.z.p.spring.web.advice.AdviceTrait      : Unauthorized: Full authentication is required to access this resource
2017-12-30 18:03:49.523  WARN 70390 --- [  XNIO-2 task-4] .m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource
2017-12-30 18:03:52.665 DEBUG 70390 --- [  XNIO-2 task-5] com.fya.config.OAuth2Configuration       : Saving login origin URI: http://localhost:9000/
2017-12-30 18:06:59.041 DEBUG 70390 --- [  XNIO-2 task-6] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with argument[s] = []
2017-12-30 18:06:59.041 DEBUG 70390 --- [  XNIO-2 task-6] com.fya.aop.logging.LoggingAspect        : Exit: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with result = com.fya.web.rest.ProfileInfoResource$ProfileInfoVM@162b0443
2017-12-30 18:06:59.060 DEBUG 70390 --- [  XNIO-2 task-7] com.fya.aop.logging.LoggingAspect        : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Sat Dec 30 18:06:59 IST 2017, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={details=org.springframework.security.web.authentication.WebAuthenticationDetails@fffdaa08: RemoteIpAddress: 127.0.0.1; SessionId: NR4EuMw7D7bTWQUeCC34fsl6B8FqKA6B3BQSDdck, type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]]
2017-12-30 18:06:59.060 DEBUG 70390 --- [  XNIO-2 task-7] com.fya.aop.logging.LoggingAspect        : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2017-12-30 18:06:59.061  WARN 70390 --- [  XNIO-2 task-7] o.z.p.spring.web.advice.AdviceTrait      : Unauthorized: Full authentication is required to access this resource
2017-12-30 18:06:59.063  WARN 70390 --- [  XNIO-2 task-7] .m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.security.authentication.InsufficientAuthenticationException: Full authentication is required to access this resource
2017-12-30 18:07:33.450 DEBUG 70390 --- [  XNIO-2 task-9] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@322fcceb9 pairs: {POST /auth/realms/jhipster/protocol/openid-connect/token HTTP/1.1: null}{Accept: application/json, application/x-www-form-urlencoded}{Content-Type: application/x-www-form-urlencoded}{Cache-Control: no-cache}{Pragma: no-cache}{User-Agent: Java/1.8.0_121}{Host: localhost:9080}{Connection: keep-alive}{Content-Length: 247}
2017-12-30 18:07:33.484 DEBUG 70390 --- [  XNIO-2 task-9] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@3f5abeeb7 pairs: {null: HTTP/1.1 200 OK}{Connection: keep-alive}{X-Powered-By: Undertow/1}{Server: WildFly/11}{Content-Type: application/json}{Content-Length: 3729}{Date: Sat, 30 Dec 2017 12:37:30 GMT}
2017-12-30 18:07:33.528 DEBUG 70390 --- [  XNIO-2 task-9] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@69f512f6 pairs: {GET /auth/realms/jhipster/protocol/openid-connect/userinfo HTTP/1.1: null}{Authorization: bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJhZDVVUWNuNFROMjdmakVoSk5nSEs4TDB5M19wdXNKaGowV09TY0xEVUxrIn0.eyJqdGkiOiJmOTA4M2M5OC05MDQwLTRhMDMtOWExNC1jODUzZWEzMTcxNzQiLCJleHAiOjE1MTQ2Mzc3NTAsIm5iZiI6MCwiaWF0IjoxNTE0NjM3NDUwLCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjkwODAvYXV0aC9yZWFsbXMvamhpcHN0ZXIiLCJhdWQiOiJ3ZWJfYXBwIiwic3ViIjoiZDM0OGYzMjMtNzZiYi00OTJlLWI0ZTEtNTljNDEwYzkwMDg0IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoid2ViX2FwcCIsImF1dGhfdGltZSI6MTUxNDYzNzQ1MCwic2Vzc2lvbl9zdGF0ZSI6Ijk0NWRjZDVkLWYxZGEtNDQyNi1hNjhlLWRiY2EwMmMxOTU0YSIsImFjciI6IjEiLCJhbGxvd2VkLW9yaWdpbnMiOlsiaHR0cDovL2xvY2FsaG9zdDo4MDgwLyoiLCJodHRwOi8vMTI3LjAuMC4xOjg3NjEvKiIsImh0dHA6Ly9sb2NhbGhvc3Q6OTAwMC8qIl0sInJlYWxtX2FjY2VzcyI6eyJyb2xlcyI6WyJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sIm5hbWUiOiJSYWtlc2ggS2FscmEiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJyYWtlc2gua2FscmExOTgzQGdtYWlsLmNvbSIsImdpdmVuX25hbWUiOiJSYWtlc2giLCJmYW1pbHlfbmFtZSI6IkthbHJhIiwiZW1haWwiOiJyYWtlc2gua2FscmExOTgzQGdtYWlsLmNvbSJ9.GIfNWkwPzjfxfoCWT6GbwCf7yi-Iwp4sxkL8Hi-NFux0gd8lz0Z1bbZHGCpKzxlZqVnxFFZGJhHjM8IlDp1Mq_3BSU8OpmTBEtcR57cm_qHDwPHPKEaLpyXLRSkRgJkCczrF0HTy7O5pvPUR74KXFIeITv41q9tdYoQoZ98NMlUCQAWuN81QGSmuqCUQyXsVx5VPmnOsYIA02Olpmt_bkRI1khY93A4orue9GKSsyBpqAogImNfCn6eAaa8eUXL-bEpDeOj47vna7F4jJROGf7irbe-Q6pd7X9k48cyB0BbjGdlFTYfk3k4365JIZHz7IF4NElMEFQwhEizUe_eurQ}{Accept: application/json}{User-Agent: Java/1.8.0_121}{Host: localhost:9080}{Connection: keep-alive}
2017-12-30 18:07:33.550 DEBUG 70390 --- [  XNIO-2 task-9] s.n.www.protocol.http.HttpURLConnection  : sun.net.www.MessageHeader@11cd6b1b8 pairs: {null: HTTP/1.1 200 OK}{Connection: keep-alive}{Cache-Control: no-cache}{X-Powered-By: Undertow/1}{Server: WildFly/11}{Content-Type: application/json}{Content-Length: 246}{Date: Sat, 30 Dec 2017 12:37:30 GMT}
2017-12-30 18:07:33.556 DEBUG 70390 --- [  XNIO-2 task-9] com.fya.aop.logging.LoggingAspect        : Enter: org.springframework.boot.actuate.audit.AuditEventRepository.add() with argument[s] = [AuditEvent [timestamp=Sat Dec 30 18:07:33 IST 2017, principal=Rakesh Kalra, type=AUTHENTICATION_SUCCESS, data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=<SESSION>, tokenType=bearertokenValue=<TOKEN>}]]
2017-12-30 18:07:33.613 DEBUG 70390 --- [  XNIO-2 task-9] com.fya.aop.logging.LoggingAspect        : Exit: org.springframework.boot.actuate.audit.AuditEventRepository.add() with result = null
2017-12-30 18:07:33.615 DEBUG 70390 --- [  XNIO-2 task-9] c.f.s.OAuth2AuthenticationSuccessHandler : Redirecting to saved login origin URI: http://localhost:9000/
2017-12-30 18:07:34.722 DEBUG 70390 --- [ XNIO-2 task-10] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with argument[s] = []
2017-12-30 18:07:34.722 DEBUG 70390 --- [ XNIO-2 task-10] com.fya.aop.logging.LoggingAspect        : Exit: com.fya.web.rest.ProfileInfoResource.getActiveProfiles() with result = com.fya.web.rest.ProfileInfoResource$ProfileInfoVM@28ca2cdc
2017-12-30 18:07:34.764 DEBUG 70390 --- [ XNIO-2 task-11] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.web.rest.AccountResource.getAccount() with argument[s] = [org.springframework.security.oauth2.provider.OAuth2Authentication@12e17699: Principal: Rakesh Kalra; Credentials: [PROTECTED]; Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1, sessionId=<SESSION>, tokenType=bearertokenValue=<TOKEN>; Granted Authorities: ROLE_USER]
2017-12-30 18:07:34.768 DEBUG 70390 --- [ XNIO-2 task-11] com.fya.aop.logging.LoggingAspect        : Enter: com.fya.service.UserService.getUserFromAuthentication() with argument[s] = [org.springframework.security.oauth2.provider.OAuth2Authentication@12e17699: Principal: Rakesh Kalra; Credentials: [PROTECTED]; Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1, sessionId=<SESSION>, tokenType=bearertokenValue=<TOKEN>; Granted Authorities: ROLE_USER]
2017-12-30 18:07:34.821 DEBUG 70390 --- [ XNIO-2 task-11] com.fya.service.UserService              : Saving user 'rakesh.kalra1983@gmail.com' in local database...
2017-12-30 18:07:34.905 ERROR 70390 --- [ XNIO-2 task-11] com.fya.aop.logging.LoggingAspect        : Exception in com.fya.service.UserService.getUserFromAuthentication() with cause = 'NULL' and exception = 'null'

javax.validation.ConstraintViolationException: null
        at org.springframework.data.mongodb.core.mapping.event.ValidatingMongoEventListener.onBeforeSave(ValidatingMongoEventListener.java:67)
        at org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener.onApplicationEvent(AbstractMongoEventListener.java:88)
        at org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener.onApplicationEvent(AbstractMongoEventListener.java:31)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
        at org.springframework.data.mongodb.core.MongoTemplate.maybeEmitEvent(MongoTemplate.java:1691)
        at org.springframework.data.mongodb.core.MongoTemplate.doInsert(MongoTemplate.java:857)
        at org.springframework.data.mongodb.core.MongoTemplate.insert(MongoTemplate.java:799)
        at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.save(SimpleMongoRepository.java:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:520)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:505)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:477)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
        at com.sun.proxy.$Proxy131.save(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
        at com.sun.proxy.$Proxy136.save(Unknown Source)
        at com.fya.service.UserService.syncUserWithIdP(UserService.java:185)
        at com.fya.service.UserService.getUserFromAuthentication(UserService.java:161)
        at com.fya.service.UserService$$FastClassBySpringCGLIB$$5f783124.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
        at com.fya.aop.logging.LoggingAspect.logAround(LoggingAspect.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
        at com.fya.service.UserService$$EnhancerBySpringCGLIB$$8355631e.getUserFromAuthentication(<generated>)
        at com.fya.web.rest.AccountResource.getAccount(AccountResource.java:60)
        at com.fya.web.rest.AccountResource$$FastClassBySpringCGLIB$$a8db46c8.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
        at com.fya.aop.logging.LoggingAspect.logAround(LoggingAspect.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:48)
        at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:34)
        at com.ryantenney.metrics.spring.AbstractMetricMethodInterceptor.invoke(AbstractMetricMethodInterceptor.java:59)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
        at com.fya.web.rest.AccountResource$$EnhancerBySpringCGLIB$$27374a8a.getAccount(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
        at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:111)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter.doFilter(OAuth2ClientContextFilter.java:60)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.fya.config.OAuth2Configuration$1.doFilterInternal(OAuth2Configuration.java:55)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
        at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:64)
        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)
        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:332)
        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

2017-12-30 18:07:34.908 ERROR 70390 --- [ XNIO-2 task-11] com.fya.aop.logging.LoggingAspect        : Exception in com.fya.web.rest.AccountResource.getAccount() with cause = 'NULL' and exception = 'null'

javax.validation.ConstraintViolationException: null
        at org.springframework.data.mongodb.core.mapping.event.ValidatingMongoEventListener.onBeforeSave(ValidatingMongoEventListener.java:67)
        at org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener.onApplicationEvent(AbstractMongoEventListener.java:88)
        at org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener.onApplicationEvent(AbstractMongoEventListener.java:31)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
        at org.springframework.data.mongodb.core.MongoTemplate.maybeEmitEvent(MongoTemplate.java:1691)
        at org.springframework.data.mongodb.core.MongoTemplate.doInsert(MongoTemplate.java:857)
        at org.springframework.data.mongodb.core.MongoTemplate.insert(MongoTemplate.java:799)
        at org.springframework.data.mongodb.repository.support.SimpleMongoRepository.save(SimpleMongoRepository.java:80)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:520)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:505)
        at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:477)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:56)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:57)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
        at com.sun.proxy.$Proxy131.save(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
        at com.sun.proxy.$Proxy136.save(Unknown Source)
        at com.fya.service.UserService.syncUserWithIdP(UserService.java:185)
        at com.fya.service.UserService.getUserFromAuthentication(UserService.java:161)
        at com.fya.service.UserService$$FastClassBySpringCGLIB$$5f783124.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
        at com.fya.aop.logging.LoggingAspect.logAround(LoggingAspect.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
        at com.fya.service.UserService$$EnhancerBySpringCGLIB$$8355631e.getUserFromAuthentication(<generated>)
        at com.fya.web.rest.AccountResource.getAccount(AccountResource.java:60)
        at com.fya.web.rest.AccountResource$$FastClassBySpringCGLIB$$a8db46c8.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:85)
        at com.fya.aop.logging.LoggingAspect.logAround(LoggingAspect.java:85)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:629)
        at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:618)
        at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:48)
        at com.ryantenney.metrics.spring.TimedMethodInterceptor.invoke(TimedMethodInterceptor.java:34)
        at com.ryantenney.metrics.spring.AbstractMetricMethodInterceptor.invoke(AbstractMetricMethodInterceptor.java:59)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
        at com.fya.web.rest.AccountResource$$EnhancerBySpringCGLIB$$27374a8a.getAccount(<generated>)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
        at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
        at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827)
        at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738)
        at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
        at com.codahale.metrics.servlet.AbstractInstrumentedFilter.doFilter(AbstractInstrumentedFilter.java:111)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.boot.web.filter.ApplicationContextHeaderFilter.doFilterInternal(ApplicationContextHeaderFilter.java:55)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:101)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:110)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:347)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:263)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter.doFilter(OAuth2ClientContextFilter.java:60)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:108)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at com.fya.config.OAuth2Configuration$1.doFilterInternal(OAuth2Configuration.java:55)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)
        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
        at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:64)
        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
        at io.undertow.servlet.handlers.SessionRestoringHandler.handleRequest(SessionRestoringHandler.java:119)
        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:332)
        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)

2017-12-30 18:07:34.917  WARN 70390 --- [ XNIO-2 task-11] o.z.p.spring.web.advice.AdviceTrait      : Bad Request: null
2017-12-30 18:07:34.927  WARN 70390 --- [ XNIO-2 task-11] .m.m.a.ExceptionHandlerExceptionResolver : Resolved exception caused by Handler execution: javax.validation.ConstraintViolationException
jdubois commented 6 years ago

Just to give you some background on this: when the user logs in, his User instance is synchronized with Keycloak (that's the UserService.getUserFromAuthentication()) you see. And this User is validated using Bean Validation -> there's a validation failing, that's why you have the javax.validation.ConstraintViolationException which is a Bean Validation error. Now what is strange is that this error is NULL (it should instead tell you what is wrong). Could you debug to see what is in your User object? Maybe it's null?

rakeshkalra1983 commented 6 years ago

Hi @jdubois on debugging, and specifically checking cause of exception, found the cause to be loginregex used as "^['.A-Za-z0-9-]$". In case of social login, user login is getting initialized to value rakesh.kalra1983@gmail.com, and this value doesn't satisfy the regex "^[_'.A-Za-z0-9-]$".

For now I have updated the regex to "^[@_'.A-Za-z0-9-]*$", and I am able to login fine now using google social login.

jdubois commented 6 years ago

Oh yes that's a very important information!!!!! Thanks for the feedback! We just changed this recently so people can't use an email address to login, that may have been a bad decision.

sendilkumarn commented 6 years ago

This needs to be handled, can we have this only when the social login is enabled or by default?

rakeshkalra1983 commented 6 years ago

Whats everyone thought about creating a random login name, when person registers using social login?

Reasoning is that if we register using social login, our login-id becomes same as primary email address setup on social provider, but what if an individual changes its primary email address latter on on social network?

For example: If I register using Facebook and my primary email address on Facebook is xyz@gmail.com. My login name can be xyz, and if xyz login already exists, then my login name can be given as xyz1 (or any other suffixing logic).

adnansenyurt commented 6 years ago

In our case, users will login with e-mail addresses as there won't be any user names. Does that mean we can't use OIDC?

jdubois commented 6 years ago

The easiest solution would be to enable back the use of an e-mail as a login:

I'm doing this.

deepu105 commented 6 years ago

@jdubois maybe people misusing email that way can be avoided by doing the below

tezcane commented 6 years ago

I always updated JHipster to turn username into supporting emails. No need for both fields. With all the logins out there it is way easier to use your email for login than a username.