Giter VIP home page Giter VIP logo

google-oauth2-spring's Introduction

google-oauth2-spring's People

Contributors

galovics avatar jollycar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

google-oauth2-spring's Issues

org.springframework.web.client.HttpClientErrorException: 403 Forbidden

Hi
After running this project I am getting the below error while hitting to http://localhost:9090/google-oauth2-spring/

11:53:10.864 [http-nio-9090-exec-2] DEBUG o.s.security.web.FilterChainProxy – / at position 1 of 11 in additional filter chain; firing Filter: ‘WebAsyncManagerIntegrationFilter’
11:53:10.864 [http-nio-9090-exec-2] DEBUG o.s.security.web.FilterChainProxy – / at position 2 of 11 in additional filter chain; firing Filter: ‘SecurityContextPersistenceFilter’
11:53:10.865 [http-nio-9090-exec-2] DEBUG o.s.security.web.FilterChainProxy – / at position 3 of 11 in additional filter chain; firing Filter: ‘HeaderWriterFilter’
11:53:10.865 [http-nio-9090-exec-2] DEBUG o.s.s.w.h.writers.HstsHeaderWriter – Not injecting HSTS header since it did not match the requestMatcher org.springframework.security.web.header.writers.HstsHeaderWriter$SecureRequestMatcher@6b62811e
11:53:10.865 [http-nio-9090-exec-2] DEBUG o.s.security.web.FilterChainProxy – / at position 4 of 11 in additional filter chain; firing Filter: ‘LogoutFilter’
11:53:10.865 [http-nio-9090-exec-2] DEBUG o.s.s.w.u.m.AntPathRequestMatcher – Checking match of request : ‘/’; against ‘/logout’
11:53:10.865 [http-nio-9090-exec-2] DEBUG o.s.security.web.FilterChainProxy – / at position 5 of 11 in additional filter chain; firing Filter: ‘OAuth2AuthenticationProcessingFilter’
11:53:10.866 [http-nio-9090-exec-2] DEBUG o.s.web.client.RestTemplate – Created GET request for “https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=ya29.GmCTBq4dQN7lxg17HlJ5BWsACPm8lvhsPW4hWKP5gSkc9NB6jTMezejTa_p6QRyzUyO0San-AV7pBYhS3owrxSPBL67iaTI6_IGYHkFKuJFj6i-6ZAC3kGVaxUmOXPkMwDM”
11:53:10.866 [http-nio-9090-exec-2] DEBUG o.s.web.client.RestTemplate – Setting request Accept header to [application/json, application/+json]
11:53:12.743 [http-nio-9090-exec-2] DEBUG o.s.web.client.RestTemplate – GET request for “https://www.googleapis.com/oauth2/v3/tokeninfo?access_token=ya29.GmCTBq4dQN7lxg17HlJ5BWsACPm8lvhsPW4hWKP5gSkc9NB6jTMezejTa_p6QRyzUyO0San-AV7pBYhS3owrxSPBL67iaTI6_IGYHkFKuJFj6i-6ZAC3kGVaxUmOXPkMwDM” resulted in 200 (OK)
11:53:12.748 [http-nio-9090-exec-2] DEBUG o.s.web.client.RestTemplate – Reading [interface java.util.Map] as “application/json;charset=UTF-8” using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@5bbb606a]
11:53:13.052 [http-nio-9090-exec-2] DEBUG o.s.web.client.RestTemplate – Created GET request for “https://www.googleapis.com/plus/v1/people/me”
11:53:13.052 [http-nio-9090-exec-2] DEBUG o.s.web.client.RestTemplate – Setting request Accept header to [application/json, application/
+json]
11:53:14.463 [http-nio-9090-exec-2] DEBUG o.s.web.client.RestTemplate – GET request for “https://www.googleapis.com/plus/v1/people/me” resulted in 403 (Forbidden); invoking error handler
11:53:14.481 [http-nio-9090-exec-2] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter – SecurityContextHolder now cleared, as request processing completed
Jan 16, 2019 11:53:14 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/google-oauth2-spring] threw exception
org.springframework.web.client.HttpClientErrorException: 403 Forbidden
at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:91)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:667)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:620)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:580)
at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:498)
at com.arnoldgalovics.api.oauth.GoogleTokenServices.getUserInfo(GoogleTokenServices.java:72)
at com.arnoldgalovics.api.oauth.GoogleTokenServices.getAuthenticationToken(GoogleTokenServices.java:62)
at com.arnoldgalovics.api.oauth.GoogleTokenServices.getAuthentication(GoogleTokenServices.java:57)
at com.arnoldgalovics.api.oauth.GoogleTokenServices.loadAuthentication(GoogleTokenServices.java:51)
at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationManager.authenticate(OAuth2AuthenticationManager.java:83)
at org.springframework.security.oauth2.provider.authentication.OAuth2AuthenticationProcessingFilter.doFilter(OAuth2AuthenticationProcessingFilter.java:150)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1468)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)

I cannot access the Zuul resource after access token expires

Hi,

Could you please tell me why after the access token expires, i cannot access the zuul resource.

I got the following error.

20:22:26.600 [qtp798874225-540] DEBUG o.s.s.w.a.ExceptionTranslationFilter: Authentication exception occurred; redirecting to authentication entry point
org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
	at org.springframework.security.access.intercept.AbstractSecurityInterceptor.credentialsNotFound(AbstractSecurityInterceptor.java:379)

I have to login again from google to regain access.

Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.