okta unable to add my jhipster microservice application











up vote
0
down vote

favorite












Initially I have setup microservice application with oauth2 and keycloak.
I was able to do that successfully. I have added all things such as SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI, SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI, SECURITY_OAUTH2_CLIENT_CLIENT_ID, SECURITY_OAUTH2_CLIENT_CLIENT_SECRET, SECURITY_OAUTH2_CLIENT_SCOPE, SECURITY_OAUTH2_RESOURCE_USER_INFO_URI. I have jhipster registry running and gateway application running. I have created a application in okta with the openidconnect type application. Screen shot is mentioned below. I able to see the http://localhost:8080. Upon clicking on sign in button I getting the below error.



app1app2app3app4app5app6error










share|improve this question


























    up vote
    0
    down vote

    favorite












    Initially I have setup microservice application with oauth2 and keycloak.
    I was able to do that successfully. I have added all things such as SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI, SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI, SECURITY_OAUTH2_CLIENT_CLIENT_ID, SECURITY_OAUTH2_CLIENT_CLIENT_SECRET, SECURITY_OAUTH2_CLIENT_SCOPE, SECURITY_OAUTH2_RESOURCE_USER_INFO_URI. I have jhipster registry running and gateway application running. I have created a application in okta with the openidconnect type application. Screen shot is mentioned below. I able to see the http://localhost:8080. Upon clicking on sign in button I getting the below error.



    app1app2app3app4app5app6error










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Initially I have setup microservice application with oauth2 and keycloak.
      I was able to do that successfully. I have added all things such as SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI, SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI, SECURITY_OAUTH2_CLIENT_CLIENT_ID, SECURITY_OAUTH2_CLIENT_CLIENT_SECRET, SECURITY_OAUTH2_CLIENT_SCOPE, SECURITY_OAUTH2_RESOURCE_USER_INFO_URI. I have jhipster registry running and gateway application running. I have created a application in okta with the openidconnect type application. Screen shot is mentioned below. I able to see the http://localhost:8080. Upon clicking on sign in button I getting the below error.



      app1app2app3app4app5app6error










      share|improve this question













      Initially I have setup microservice application with oauth2 and keycloak.
      I was able to do that successfully. I have added all things such as SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI, SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI, SECURITY_OAUTH2_CLIENT_CLIENT_ID, SECURITY_OAUTH2_CLIENT_CLIENT_SECRET, SECURITY_OAUTH2_CLIENT_SCOPE, SECURITY_OAUTH2_RESOURCE_USER_INFO_URI. I have jhipster registry running and gateway application running. I have created a application in okta with the openidconnect type application. Screen shot is mentioned below. I able to see the http://localhost:8080. Upon clicking on sign in button I getting the below error.



      app1app2app3app4app5app6error







      jhipster okta okta-api jhipster-registry






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      Satyanvesh Muppaneni

      206




      206
























          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote













          If you look in your browser’s address bar on the 400 error page, you’ll see it has “http://localhost:8080/login” as the redirect URI. Add this value to the Login redirect URIs in your Okta app and you should be good to go.






          share|improve this answer





















          • Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page
            – Satyanvesh Muppaneni
            yesterday










          • FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=dev-558029.oktapreview.com/oauth2/default/v1/userinfo
            – Satyanvesh Muppaneni
            yesterday












          • In okta app the login redirect uri is : localhost:8080/login Initiate login uri is : localhost:8080
            – Satyanvesh Muppaneni
            yesterday




















          up vote
          0
          down vote













          I have made changes as said. Upon invoking url "http://localhost:8080", I was able to see the welcome page of jhipster where it says to sign in with admin/admin or user/user. On this page if got the following errors which mentioned in below image
          enter image description here



          After clicking on sign in button i was redirected to okta login page and instead of login i got the below screen shot.



          enter image description here



          Here is the updated okta app settings where i made changes after making several permutations and combinations



          enter image description here






          share|improve this answer






























            up vote
            0
            down vote













            Im sensing the problem is with authentication. I have created a user called admin in my okta developer account. In java logs i saw the below error




            2018-11-12 10:51:02.720 DEBUG 29646 --- [ XNIO-2 task-13]
            c.m.myapp.config.OAuth2Configuration : Saving login origin URI:
            http://localhost:8080/ 2018-11-12 10:51:02.721 WARN 29646 --- [
            XNIO-2 task-13] o.s.c.n.zuul.web.ZuulHandlerMapping : No routes
            found from RouteLocator 2018-11-12 10:51:04.015 DEBUG 29646 --- [
            XNIO-2 task-13] c.m.myapp.aop.logging.LoggingAspect : Enter:
            com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
            argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:04.014Z,
            principal=0oahe7g64oGVGiok50h7, type=AUTHENTICATION_SUCCESS,
            data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
            tokenType=BearertokenValue=}]] Hibernate: insert into
            jhi_persistent_audit_event (event_date, event_type, principal) values
            (?, ?, ?) 2018-11-12 10:51:04.022 DEBUG 29646 --- [ XNIO-2 task-13]
            c.m.myapp.aop.logging.LoggingAspect : Exit:
            com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
            result = null Hibernate: insert into jhi_persistent_audit_evt_data
            (event_id, name, value) values (?, ?, ?) 2018-11-12 10:51:04.029 DEBUG
            29646 --- [ XNIO-2 task-13] m.m.s.OAuth2AuthenticationSuccessHandler :
            Redirecting to saved login origin URI: http://localhost:8080/
            2018-11-12 10:51:05.039 DEBUG 29646 --- [ XNIO-2 task-15]
            c.m.myapp.aop.logging.LoggingAspect : Enter:
            com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
            argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:05.039Z,
            principal=0oahe7g64oGVGiok50h7, type=AUTHORIZATION_FAILURE,
            data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
            tokenType=BearertokenValue=,
            type=org.springframework.security.access.AccessDeniedException,
            message=Access is denied}]] 2018-11-12 10:51:05.039 DEBUG 29646 --- [
            XNIO-2 task-15] c.m.myapp.aop.logging.LoggingAspect : Exit:
            com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
            result = null 2018-11-12 10:51:05.079 DEBUG 29646 --- [ XNIO-2
            task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
            com.mycompany.myapp.web.rest.AccountResource.getAccount() with
            argument[s] =
            [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
            Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
            Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
            sessionId=, tokenType=BearertokenValue=; Not granted
            any authorities] 2018-11-12 10:51:05.081 DEBUG 29646 --- [ XNIO-2
            task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
            com.mycompany.myapp.service.UserService.getUserFromAuthentication()
            with argument[s] =
            [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
            Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
            Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
            sessionId=, tokenType=BearertokenValue=; Not granted
            any authorities] 2018-11-12 10:51:05.082 ERROR 29646 --- [ XNIO-2
            task-16] c.m.myapp.aop.logging.LoggingAspect : Exception in
            com.mycompany.myapp.service.UserService.getUserFromAuthentication()
            with cause = 'NULL' and exception = 'null'



            java.lang.NullPointerException: null at
            com.mycompany.myapp.service.UserService.getUserFromAuthentication(UserService.java:153)
            at
            com.mycompany.myapp.service.UserService$$FastClassBySpringCGLIB$$2169c3ce.invoke()
            at
            org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
            at
            org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
            at
            org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
            at
            com.mycompany.myapp.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:644)
            at
            org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
            at
            org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            at
            org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            at
            org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
            at
            org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            at
            org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            at
            org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
            at
            com.mycompany.myapp.service.UserService$$EnhancerBySpringCGLIB$$599f99c8.getUserFromAuthentication()
            at
            com.mycompany.myapp.web.rest.AccountResource.getAccount(AccountResource.java:59)
            at
            com.mycompany.myapp.web.rest.AccountResource$$FastClassBySpringCGLIB$$bb2cce5e.invoke()
            at
            org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
            at
            org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
            at
            org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
            at
            com.mycompany.myapp.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:644)
            at
            org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
            at
            org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            at
            org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            at
            org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
            at
            org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
            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:185)
            at
            org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
            at
            com.mycompany.myapp.web.rest.AccountResource$$EnhancerBySpringCGLIB$$fc91dc3c.getAccount()
            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:209)
            at
            org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
            at
            org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
            at
            org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
            at
            org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
            at
            org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
            at
            org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
            at
            org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
            at
            org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
            at
            org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at
            org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at
            io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
            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.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







            share|improve this answer























              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238520%2fokta-unable-to-add-my-jhipster-microservice-application%23new-answer', 'question_page');
              }
              );

              Post as a guest
































              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              If you look in your browser’s address bar on the 400 error page, you’ll see it has “http://localhost:8080/login” as the redirect URI. Add this value to the Login redirect URIs in your Okta app and you should be good to go.






              share|improve this answer





















              • Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page
                – Satyanvesh Muppaneni
                yesterday










              • FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=dev-558029.oktapreview.com/oauth2/default/v1/userinfo
                – Satyanvesh Muppaneni
                yesterday












              • In okta app the login redirect uri is : localhost:8080/login Initiate login uri is : localhost:8080
                – Satyanvesh Muppaneni
                yesterday

















              up vote
              1
              down vote













              If you look in your browser’s address bar on the 400 error page, you’ll see it has “http://localhost:8080/login” as the redirect URI. Add this value to the Login redirect URIs in your Okta app and you should be good to go.






              share|improve this answer





















              • Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page
                – Satyanvesh Muppaneni
                yesterday










              • FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=dev-558029.oktapreview.com/oauth2/default/v1/userinfo
                – Satyanvesh Muppaneni
                yesterday












              • In okta app the login redirect uri is : localhost:8080/login Initiate login uri is : localhost:8080
                – Satyanvesh Muppaneni
                yesterday















              up vote
              1
              down vote










              up vote
              1
              down vote









              If you look in your browser’s address bar on the 400 error page, you’ll see it has “http://localhost:8080/login” as the redirect URI. Add this value to the Login redirect URIs in your Okta app and you should be good to go.






              share|improve this answer












              If you look in your browser’s address bar on the 400 error page, you’ll see it has “http://localhost:8080/login” as the redirect URI. Add this value to the Login redirect URIs in your Okta app and you should be good to go.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered yesterday









              Matt Raible

              2,68352970




              2,68352970












              • Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page
                – Satyanvesh Muppaneni
                yesterday










              • FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=dev-558029.oktapreview.com/oauth2/default/v1/userinfo
                – Satyanvesh Muppaneni
                yesterday












              • In okta app the login redirect uri is : localhost:8080/login Initiate login uri is : localhost:8080
                – Satyanvesh Muppaneni
                yesterday




















              • Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page
                – Satyanvesh Muppaneni
                yesterday










              • FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=dev-558029.oktapreview.com/oauth2/default/v1/userinfo
                – Satyanvesh Muppaneni
                yesterday












              • In okta app the login redirect uri is : localhost:8080/login Initiate login uri is : localhost:8080
                – Satyanvesh Muppaneni
                yesterday


















              Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page
              – Satyanvesh Muppaneni
              yesterday




              Thanks for the response. I have added as you said, but its redirecting to login page but not signing into application. My requirement is, upon clicking on the application(once the user is assigned this app), as he has already authenticated from okta, upon clicking the application he should see the home page
              – Satyanvesh Muppaneni
              yesterday












              FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=dev-558029.oktapreview.com/oauth2/default/v1/userinfo
              – Satyanvesh Muppaneni
              yesterday






              FYI, following are my env variable in app.yml - SECURITY_OAUTH2_CLIENT_ACCESS_TOKEN_URI=dev-558029.oktapreview.com/oauth2/default/v1/token - SECURITY_OAUTH2_CLIENT_USER_AUTHORIZATION_URI=dev-558029.oktapreview.com/oauth2/default/v1/authorize - SECURITY_OAUTH2_CLIENT_CLIENT_ID=0oah8azcnaz2GunyT0h7 - SECURITY_OAUTH2_CLIENT_CLIENT_SECRET= D5j6vS_eNT3G56jN81riyV8w9rbxuQZph7L2wfgk - SECURITY_OAUTH2_CLIENT_SCOPE=openid profile email - SECURITY_OAUTH2_RESOURCE_USER_INFO_URI=dev-558029.oktapreview.com/oauth2/default/v1/userinfo
              – Satyanvesh Muppaneni
              yesterday














              In okta app the login redirect uri is : localhost:8080/login Initiate login uri is : localhost:8080
              – Satyanvesh Muppaneni
              yesterday






              In okta app the login redirect uri is : localhost:8080/login Initiate login uri is : localhost:8080
              – Satyanvesh Muppaneni
              yesterday














              up vote
              0
              down vote













              I have made changes as said. Upon invoking url "http://localhost:8080", I was able to see the welcome page of jhipster where it says to sign in with admin/admin or user/user. On this page if got the following errors which mentioned in below image
              enter image description here



              After clicking on sign in button i was redirected to okta login page and instead of login i got the below screen shot.



              enter image description here



              Here is the updated okta app settings where i made changes after making several permutations and combinations



              enter image description here






              share|improve this answer



























                up vote
                0
                down vote













                I have made changes as said. Upon invoking url "http://localhost:8080", I was able to see the welcome page of jhipster where it says to sign in with admin/admin or user/user. On this page if got the following errors which mentioned in below image
                enter image description here



                After clicking on sign in button i was redirected to okta login page and instead of login i got the below screen shot.



                enter image description here



                Here is the updated okta app settings where i made changes after making several permutations and combinations



                enter image description here






                share|improve this answer

























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  I have made changes as said. Upon invoking url "http://localhost:8080", I was able to see the welcome page of jhipster where it says to sign in with admin/admin or user/user. On this page if got the following errors which mentioned in below image
                  enter image description here



                  After clicking on sign in button i was redirected to okta login page and instead of login i got the below screen shot.



                  enter image description here



                  Here is the updated okta app settings where i made changes after making several permutations and combinations



                  enter image description here






                  share|improve this answer














                  I have made changes as said. Upon invoking url "http://localhost:8080", I was able to see the welcome page of jhipster where it says to sign in with admin/admin or user/user. On this page if got the following errors which mentioned in below image
                  enter image description here



                  After clicking on sign in button i was redirected to okta login page and instead of login i got the below screen shot.



                  enter image description here



                  Here is the updated okta app settings where i made changes after making several permutations and combinations



                  enter image description here







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 2 hours ago

























                  answered 18 hours ago









                  Satyanvesh Muppaneni

                  206




                  206






















                      up vote
                      0
                      down vote













                      Im sensing the problem is with authentication. I have created a user called admin in my okta developer account. In java logs i saw the below error




                      2018-11-12 10:51:02.720 DEBUG 29646 --- [ XNIO-2 task-13]
                      c.m.myapp.config.OAuth2Configuration : Saving login origin URI:
                      http://localhost:8080/ 2018-11-12 10:51:02.721 WARN 29646 --- [
                      XNIO-2 task-13] o.s.c.n.zuul.web.ZuulHandlerMapping : No routes
                      found from RouteLocator 2018-11-12 10:51:04.015 DEBUG 29646 --- [
                      XNIO-2 task-13] c.m.myapp.aop.logging.LoggingAspect : Enter:
                      com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                      argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:04.014Z,
                      principal=0oahe7g64oGVGiok50h7, type=AUTHENTICATION_SUCCESS,
                      data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                      tokenType=BearertokenValue=}]] Hibernate: insert into
                      jhi_persistent_audit_event (event_date, event_type, principal) values
                      (?, ?, ?) 2018-11-12 10:51:04.022 DEBUG 29646 --- [ XNIO-2 task-13]
                      c.m.myapp.aop.logging.LoggingAspect : Exit:
                      com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                      result = null Hibernate: insert into jhi_persistent_audit_evt_data
                      (event_id, name, value) values (?, ?, ?) 2018-11-12 10:51:04.029 DEBUG
                      29646 --- [ XNIO-2 task-13] m.m.s.OAuth2AuthenticationSuccessHandler :
                      Redirecting to saved login origin URI: http://localhost:8080/
                      2018-11-12 10:51:05.039 DEBUG 29646 --- [ XNIO-2 task-15]
                      c.m.myapp.aop.logging.LoggingAspect : Enter:
                      com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                      argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:05.039Z,
                      principal=0oahe7g64oGVGiok50h7, type=AUTHORIZATION_FAILURE,
                      data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                      tokenType=BearertokenValue=,
                      type=org.springframework.security.access.AccessDeniedException,
                      message=Access is denied}]] 2018-11-12 10:51:05.039 DEBUG 29646 --- [
                      XNIO-2 task-15] c.m.myapp.aop.logging.LoggingAspect : Exit:
                      com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                      result = null 2018-11-12 10:51:05.079 DEBUG 29646 --- [ XNIO-2
                      task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                      com.mycompany.myapp.web.rest.AccountResource.getAccount() with
                      argument[s] =
                      [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                      Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                      Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                      sessionId=, tokenType=BearertokenValue=; Not granted
                      any authorities] 2018-11-12 10:51:05.081 DEBUG 29646 --- [ XNIO-2
                      task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                      com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                      with argument[s] =
                      [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                      Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                      Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                      sessionId=, tokenType=BearertokenValue=; Not granted
                      any authorities] 2018-11-12 10:51:05.082 ERROR 29646 --- [ XNIO-2
                      task-16] c.m.myapp.aop.logging.LoggingAspect : Exception in
                      com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                      with cause = 'NULL' and exception = 'null'



                      java.lang.NullPointerException: null at
                      com.mycompany.myapp.service.UserService.getUserFromAuthentication(UserService.java:153)
                      at
                      com.mycompany.myapp.service.UserService$$FastClassBySpringCGLIB$$2169c3ce.invoke()
                      at
                      org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                      at
                      org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                      at
                      org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                      at
                      com.mycompany.myapp.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:644)
                      at
                      org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                      at
                      org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                      at
                      org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                      at
                      org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
                      at
                      org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                      at
                      org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                      at
                      org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                      at
                      com.mycompany.myapp.service.UserService$$EnhancerBySpringCGLIB$$599f99c8.getUserFromAuthentication()
                      at
                      com.mycompany.myapp.web.rest.AccountResource.getAccount(AccountResource.java:59)
                      at
                      com.mycompany.myapp.web.rest.AccountResource$$FastClassBySpringCGLIB$$bb2cce5e.invoke()
                      at
                      org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                      at
                      org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                      at
                      org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                      at
                      com.mycompany.myapp.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:644)
                      at
                      org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                      at
                      org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                      at
                      org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                      at
                      org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                      at
                      org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                      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:185)
                      at
                      org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                      at
                      com.mycompany.myapp.web.rest.AccountResource$$EnhancerBySpringCGLIB$$fc91dc3c.getAccount()
                      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:209)
                      at
                      org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
                      at
                      org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
                      at
                      org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
                      at
                      org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
                      at
                      org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
                      at
                      org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
                      at
                      org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
                      at
                      org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
                      at
                      org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at
                      org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at
                      io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
                      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.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







                      share|improve this answer



























                        up vote
                        0
                        down vote













                        Im sensing the problem is with authentication. I have created a user called admin in my okta developer account. In java logs i saw the below error




                        2018-11-12 10:51:02.720 DEBUG 29646 --- [ XNIO-2 task-13]
                        c.m.myapp.config.OAuth2Configuration : Saving login origin URI:
                        http://localhost:8080/ 2018-11-12 10:51:02.721 WARN 29646 --- [
                        XNIO-2 task-13] o.s.c.n.zuul.web.ZuulHandlerMapping : No routes
                        found from RouteLocator 2018-11-12 10:51:04.015 DEBUG 29646 --- [
                        XNIO-2 task-13] c.m.myapp.aop.logging.LoggingAspect : Enter:
                        com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                        argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:04.014Z,
                        principal=0oahe7g64oGVGiok50h7, type=AUTHENTICATION_SUCCESS,
                        data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                        tokenType=BearertokenValue=}]] Hibernate: insert into
                        jhi_persistent_audit_event (event_date, event_type, principal) values
                        (?, ?, ?) 2018-11-12 10:51:04.022 DEBUG 29646 --- [ XNIO-2 task-13]
                        c.m.myapp.aop.logging.LoggingAspect : Exit:
                        com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                        result = null Hibernate: insert into jhi_persistent_audit_evt_data
                        (event_id, name, value) values (?, ?, ?) 2018-11-12 10:51:04.029 DEBUG
                        29646 --- [ XNIO-2 task-13] m.m.s.OAuth2AuthenticationSuccessHandler :
                        Redirecting to saved login origin URI: http://localhost:8080/
                        2018-11-12 10:51:05.039 DEBUG 29646 --- [ XNIO-2 task-15]
                        c.m.myapp.aop.logging.LoggingAspect : Enter:
                        com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                        argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:05.039Z,
                        principal=0oahe7g64oGVGiok50h7, type=AUTHORIZATION_FAILURE,
                        data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                        tokenType=BearertokenValue=,
                        type=org.springframework.security.access.AccessDeniedException,
                        message=Access is denied}]] 2018-11-12 10:51:05.039 DEBUG 29646 --- [
                        XNIO-2 task-15] c.m.myapp.aop.logging.LoggingAspect : Exit:
                        com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                        result = null 2018-11-12 10:51:05.079 DEBUG 29646 --- [ XNIO-2
                        task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                        com.mycompany.myapp.web.rest.AccountResource.getAccount() with
                        argument[s] =
                        [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                        Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                        Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                        sessionId=, tokenType=BearertokenValue=; Not granted
                        any authorities] 2018-11-12 10:51:05.081 DEBUG 29646 --- [ XNIO-2
                        task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                        com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                        with argument[s] =
                        [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                        Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                        Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                        sessionId=, tokenType=BearertokenValue=; Not granted
                        any authorities] 2018-11-12 10:51:05.082 ERROR 29646 --- [ XNIO-2
                        task-16] c.m.myapp.aop.logging.LoggingAspect : Exception in
                        com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                        with cause = 'NULL' and exception = 'null'



                        java.lang.NullPointerException: null at
                        com.mycompany.myapp.service.UserService.getUserFromAuthentication(UserService.java:153)
                        at
                        com.mycompany.myapp.service.UserService$$FastClassBySpringCGLIB$$2169c3ce.invoke()
                        at
                        org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                        at
                        org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                        at
                        org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                        at
                        com.mycompany.myapp.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:644)
                        at
                        org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                        at
                        org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                        at
                        org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                        at
                        org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
                        at
                        org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                        at
                        org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                        at
                        org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                        at
                        com.mycompany.myapp.service.UserService$$EnhancerBySpringCGLIB$$599f99c8.getUserFromAuthentication()
                        at
                        com.mycompany.myapp.web.rest.AccountResource.getAccount(AccountResource.java:59)
                        at
                        com.mycompany.myapp.web.rest.AccountResource$$FastClassBySpringCGLIB$$bb2cce5e.invoke()
                        at
                        org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                        at
                        org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                        at
                        org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                        at
                        com.mycompany.myapp.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:644)
                        at
                        org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                        at
                        org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                        at
                        org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                        at
                        org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                        at
                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                        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:185)
                        at
                        org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                        at
                        com.mycompany.myapp.web.rest.AccountResource$$EnhancerBySpringCGLIB$$fc91dc3c.getAccount()
                        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:209)
                        at
                        org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
                        at
                        org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
                        at
                        org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
                        at
                        org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
                        at
                        org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
                        at
                        org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
                        at
                        org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
                        at
                        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
                        at
                        org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
                        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at
                        org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
                        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at
                        io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
                        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.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







                        share|improve this answer

























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Im sensing the problem is with authentication. I have created a user called admin in my okta developer account. In java logs i saw the below error




                          2018-11-12 10:51:02.720 DEBUG 29646 --- [ XNIO-2 task-13]
                          c.m.myapp.config.OAuth2Configuration : Saving login origin URI:
                          http://localhost:8080/ 2018-11-12 10:51:02.721 WARN 29646 --- [
                          XNIO-2 task-13] o.s.c.n.zuul.web.ZuulHandlerMapping : No routes
                          found from RouteLocator 2018-11-12 10:51:04.015 DEBUG 29646 --- [
                          XNIO-2 task-13] c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:04.014Z,
                          principal=0oahe7g64oGVGiok50h7, type=AUTHENTICATION_SUCCESS,
                          data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                          tokenType=BearertokenValue=}]] Hibernate: insert into
                          jhi_persistent_audit_event (event_date, event_type, principal) values
                          (?, ?, ?) 2018-11-12 10:51:04.022 DEBUG 29646 --- [ XNIO-2 task-13]
                          c.m.myapp.aop.logging.LoggingAspect : Exit:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          result = null Hibernate: insert into jhi_persistent_audit_evt_data
                          (event_id, name, value) values (?, ?, ?) 2018-11-12 10:51:04.029 DEBUG
                          29646 --- [ XNIO-2 task-13] m.m.s.OAuth2AuthenticationSuccessHandler :
                          Redirecting to saved login origin URI: http://localhost:8080/
                          2018-11-12 10:51:05.039 DEBUG 29646 --- [ XNIO-2 task-15]
                          c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:05.039Z,
                          principal=0oahe7g64oGVGiok50h7, type=AUTHORIZATION_FAILURE,
                          data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                          tokenType=BearertokenValue=,
                          type=org.springframework.security.access.AccessDeniedException,
                          message=Access is denied}]] 2018-11-12 10:51:05.039 DEBUG 29646 --- [
                          XNIO-2 task-15] c.m.myapp.aop.logging.LoggingAspect : Exit:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          result = null 2018-11-12 10:51:05.079 DEBUG 29646 --- [ XNIO-2
                          task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.web.rest.AccountResource.getAccount() with
                          argument[s] =
                          [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                          Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                          Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                          sessionId=, tokenType=BearertokenValue=; Not granted
                          any authorities] 2018-11-12 10:51:05.081 DEBUG 29646 --- [ XNIO-2
                          task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                          with argument[s] =
                          [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                          Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                          Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                          sessionId=, tokenType=BearertokenValue=; Not granted
                          any authorities] 2018-11-12 10:51:05.082 ERROR 29646 --- [ XNIO-2
                          task-16] c.m.myapp.aop.logging.LoggingAspect : Exception in
                          com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                          with cause = 'NULL' and exception = 'null'



                          java.lang.NullPointerException: null at
                          com.mycompany.myapp.service.UserService.getUserFromAuthentication(UserService.java:153)
                          at
                          com.mycompany.myapp.service.UserService$$FastClassBySpringCGLIB$$2169c3ce.invoke()
                          at
                          org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                          at
                          org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                          at
                          org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                          at
                          com.mycompany.myapp.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:644)
                          at
                          org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                          at
                          org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
                          at
                          org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                          at
                          com.mycompany.myapp.service.UserService$$EnhancerBySpringCGLIB$$599f99c8.getUserFromAuthentication()
                          at
                          com.mycompany.myapp.web.rest.AccountResource.getAccount(AccountResource.java:59)
                          at
                          com.mycompany.myapp.web.rest.AccountResource$$FastClassBySpringCGLIB$$bb2cce5e.invoke()
                          at
                          org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                          at
                          org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                          at
                          org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                          at
                          com.mycompany.myapp.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:644)
                          at
                          org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                          at
                          org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          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:185)
                          at
                          org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                          at
                          com.mycompany.myapp.web.rest.AccountResource$$EnhancerBySpringCGLIB$$fc91dc3c.getAccount()
                          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:209)
                          at
                          org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
                          at
                          org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
                          at
                          org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
                          at
                          org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
                          at
                          org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
                          at
                          org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
                          at
                          org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
                          at
                          org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
                          at
                          org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at
                          org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at
                          io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
                          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.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







                          share|improve this answer














                          Im sensing the problem is with authentication. I have created a user called admin in my okta developer account. In java logs i saw the below error




                          2018-11-12 10:51:02.720 DEBUG 29646 --- [ XNIO-2 task-13]
                          c.m.myapp.config.OAuth2Configuration : Saving login origin URI:
                          http://localhost:8080/ 2018-11-12 10:51:02.721 WARN 29646 --- [
                          XNIO-2 task-13] o.s.c.n.zuul.web.ZuulHandlerMapping : No routes
                          found from RouteLocator 2018-11-12 10:51:04.015 DEBUG 29646 --- [
                          XNIO-2 task-13] c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:04.014Z,
                          principal=0oahe7g64oGVGiok50h7, type=AUTHENTICATION_SUCCESS,
                          data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                          tokenType=BearertokenValue=}]] Hibernate: insert into
                          jhi_persistent_audit_event (event_date, event_type, principal) values
                          (?, ?, ?) 2018-11-12 10:51:04.022 DEBUG 29646 --- [ XNIO-2 task-13]
                          c.m.myapp.aop.logging.LoggingAspect : Exit:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          result = null Hibernate: insert into jhi_persistent_audit_evt_data
                          (event_id, name, value) values (?, ?, ?) 2018-11-12 10:51:04.029 DEBUG
                          29646 --- [ XNIO-2 task-13] m.m.s.OAuth2AuthenticationSuccessHandler :
                          Redirecting to saved login origin URI: http://localhost:8080/
                          2018-11-12 10:51:05.039 DEBUG 29646 --- [ XNIO-2 task-15]
                          c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          argument[s] = [AuditEvent [timestamp=2018-11-12T05:21:05.039Z,
                          principal=0oahe7g64oGVGiok50h7, type=AUTHORIZATION_FAILURE,
                          data={details=remoteAddress=0:0:0:0:0:0:0:1, sessionId=,
                          tokenType=BearertokenValue=,
                          type=org.springframework.security.access.AccessDeniedException,
                          message=Access is denied}]] 2018-11-12 10:51:05.039 DEBUG 29646 --- [
                          XNIO-2 task-15] c.m.myapp.aop.logging.LoggingAspect : Exit:
                          com.mycompany.myapp.repository.CustomAuditEventRepository.add() with
                          result = null 2018-11-12 10:51:05.079 DEBUG 29646 --- [ XNIO-2
                          task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.web.rest.AccountResource.getAccount() with
                          argument[s] =
                          [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                          Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                          Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                          sessionId=, tokenType=BearertokenValue=; Not granted
                          any authorities] 2018-11-12 10:51:05.081 DEBUG 29646 --- [ XNIO-2
                          task-16] c.m.myapp.aop.logging.LoggingAspect : Enter:
                          com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                          with argument[s] =
                          [org.springframework.security.oauth2.provider.OAuth2Authentication@cf5e6315:
                          Principal: 0oahe7g64oGVGiok50h7; Credentials: [PROTECTED];
                          Authenticated: true; Details: remoteAddress=0:0:0:0:0:0:0:1,
                          sessionId=, tokenType=BearertokenValue=; Not granted
                          any authorities] 2018-11-12 10:51:05.082 ERROR 29646 --- [ XNIO-2
                          task-16] c.m.myapp.aop.logging.LoggingAspect : Exception in
                          com.mycompany.myapp.service.UserService.getUserFromAuthentication()
                          with cause = 'NULL' and exception = 'null'



                          java.lang.NullPointerException: null at
                          com.mycompany.myapp.service.UserService.getUserFromAuthentication(UserService.java:153)
                          at
                          com.mycompany.myapp.service.UserService$$FastClassBySpringCGLIB$$2169c3ce.invoke()
                          at
                          org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                          at
                          org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                          at
                          org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                          at
                          com.mycompany.myapp.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:644)
                          at
                          org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                          at
                          org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:294)
                          at
                          org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                          at
                          com.mycompany.myapp.service.UserService$$EnhancerBySpringCGLIB$$599f99c8.getUserFromAuthentication()
                          at
                          com.mycompany.myapp.web.rest.AccountResource.getAccount(AccountResource.java:59)
                          at
                          com.mycompany.myapp.web.rest.AccountResource$$FastClassBySpringCGLIB$$bb2cce5e.invoke()
                          at
                          org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
                          at
                          org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
                          at
                          org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)
                          at
                          com.mycompany.myapp.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:644)
                          at
                          org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)
                          at
                          org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.aspectj.AspectJAfterThrowingAdvice.invoke(AspectJAfterThrowingAdvice.java:62)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          at
                          org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)
                          at
                          org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
                          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:185)
                          at
                          org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)
                          at
                          com.mycompany.myapp.web.rest.AccountResource$$EnhancerBySpringCGLIB$$fc91dc3c.getAccount()
                          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:209)
                          at
                          org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
                          at
                          org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
                          at
                          org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891)
                          at
                          org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
                          at
                          org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
                          at
                          org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
                          at
                          org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)
                          at
                          org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974)
                          at
                          org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at
                          org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851)
                          at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at
                          io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
                          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.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








                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited 7 mins ago

























                          answered 30 mins ago









                          Satyanvesh Muppaneni

                          206




                          206






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238520%2fokta-unable-to-add-my-jhipster-microservice-application%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest




















































































                              Popular posts from this blog

                              Xamarin.iOS Cant Deploy on Iphone

                              Glorious Revolution

                              Dulmage-Mendelsohn matrix decomposition in Python