Grails3.2.11从移动(android)应用程序访问安全API的后端问题

时间:2018-03-15 08:22:23

标签: grails spring-security-rest

它是一个RESTful(Grails 3.2.11后端)应用程序,带有spring-security-rest:2.0.0.M2插件。 角度前端工作正常。 从移动设备( android )应用程序登录时,它会返回令牌。但是在连续的安全API中使用与Bearer相同的标记,它会抛出

  

WWW-authenticate:Bearer error =“invalid_token”

回复标题。 它已被交叉检查,登录用户有足够的权限访问这些API,因此不是未经授权的访问的情况。 并且令牌存在于mongodb的authenticationToken集合中。 此外,如果我在Web应用程序(角度前端)中使用相同的用户登录,则它可以正常工作。

以下是spring-security调试片段(远程IP和用户名被屏蔽)

14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Request '/api/login' matched by universal pattern '/**'
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 1 of 12 in additional filter chain; firing Filter: 'SecurityRequestHolderFilter'
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No HttpSession currently exists
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 3 of 12 in additional filter chain; firing Filter: 'MutableLogoutFilter'
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/api/login'; against '/logoff'
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 4 of 12 in additional filter chain; firing Filter: 'GrailsUsernamePasswordAuthenticationFilter'
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 5 of 12 in additional filter chain; firing Filter: 'RestAuthenticationFilter'
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG g.p.s.rest.RestAuthenticationFilter - Actual URI is /api/login; endpoint URL is /api/login
14.03.2018 12:03:22.383 [http-nio-8080-exec-10] DEBUG g.p.s.rest.RestAuthenticationFilter - Applying authentication filter to this request
14.03.2018 12:03:22.421 [http-nio-8080-exec-10] DEBUG g.p.s.r.c.DefaultJsonPayloadCredentialsExtractor - Extracted credentials from JSON payload. Username: , password: [PROTECTED]
14.03.2018 12:03:22.424 [http-nio-8080-exec-10] DEBUG g.p.s.rest.RestAuthenticationFilter - Trying to authenticate the request
14.03.2018 12:03:22.425 [http-nio-8080-exec-10] DEBUG o.s.s.a.ProviderManager - Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider
14.03.2018 12:03:22.551 [http-nio-8080-exec-10] DEBUG o.s.s.a.h.RoleHierarchyImpl - getReachableGrantedAuthorities() - From the roles [ROLE_ADMIN] one can reach [ROLE_ADMIN] in zero or more steps.
14.03.2018 12:03:22.552 [http-nio-8080-exec-10] DEBUG g.p.s.rest.RestAuthenticationFilter - Request authenticated. Storing the authentication result in the security context
14.03.2018 12:03:22.552 [http-nio-8080-exec-10] DEBUG g.p.s.rest.RestAuthenticationFilter - Authentication result: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@f0f156db: Principal: grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff8868: RemoteIpAddress: ; SessionId: null; Granted Authorities: ROLE_ADMIN
14.03.2018 12:03:22.557 [http-nio-8080-exec-10] DEBUG g.p.s.rest.RestAuthenticationFilter - Generated token: grails.plugin.springsecurity.rest.token.AccessToken(accessToken:nle37eh3dl7hnu1fnge4al46ttcoavnv, expiration:null, refreshToken:null, principal:grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN, super:grails.plugin.springsecurity.rest.token.AccessToken@f0edeb3: Principal: grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: null; Granted Authorities: ROLE_ADMIN)
14.03.2018 12:03:22.558 [http-nio-8080-exec-10] DEBUG g.p.s.r.t.s.GormTokenStorageService - Storing principal for token: nle37eh3dl7hnu1fnge4al46ttcoavnv
14.03.2018 12:03:22.558 [http-nio-8080-exec-10] DEBUG g.p.s.r.t.s.GormTokenStorageService - Principal: grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN
14.03.2018 12:03:22.676 [http-nio-8080-exec-10] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - The HttpSession is currently null, and the HttpSessionSecurityContextRepository is prohibited from creating an HttpSession (because the allowSessionCreation property is false) - SecurityContext thus not stored for next request
14.03.2018 12:03:22.677 [http-nio-8080-exec-10] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Request '/api/userapi/getconfig' matched by universal pattern '/**'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 1 of 12 in additional filter chain; firing Filter: 'SecurityRequestHolderFilter'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No HttpSession currently exists
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 3 of 12 in additional filter chain; firing Filter: 'MutableLogoutFilter'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/api/userapi/getconfig'; against '/logoff'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 4 of 12 in additional filter chain; firing Filter: 'GrailsUsernamePasswordAuthenticationFilter'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 5 of 12 in additional filter chain; firing Filter: 'RestAuthenticationFilter'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG g.p.s.rest.RestAuthenticationFilter - Actual URI is /api/userAPI/getConfig; endpoint URL is /api/login
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 6 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 7 of 12 in additional filter chain; firing Filter: 'GrailsRememberMeAuthenticationFilter'
14.03.2018 12:03:22.888 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 8 of 12 in additional filter chain; firing Filter: 'GrailsAnonymousAuthenticationFilter'
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.w.f.GrailsAnonymousAuthenticationFilter - Populated SecurityContextHolder with anonymous token: 'grails.plugin.springsecurity.authentication.GrailsAnonymousAuthenticationToken@f23b2e68: Principal: org.springframework.security.core.userdetails.User@dc730200: Username: __grails.anonymous.user__; Password: [PROTECTED]; Enabled: false; AccountNonExpired: false; credentialsNonExpired: false; AccountNonLocked: false; Granted Authorities: ROLE_ANONYMOUS; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff8868: RemoteIpAddress: ; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 9 of 12 in additional filter chain; firing Filter: 'RestTokenValidationFilter'
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Looking for bearer token in Authorization header, query string or Form-Encoded body parameter
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Found bearer token in Authorization header
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Token: nle37eh3dl7hnu1fnge4al46ttcoavnv
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.RestTokenValidationFilter - Token found: nle37eh3dl7hnu1fnge4al46ttcoavnv
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.RestTokenValidationFilter - Trying to authenticate the token
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.RestAuthenticationProvider - Use JWT: false
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.RestAuthenticationProvider - Trying to validate token nle37eh3dl7hnu1fnge4al46ttcoavnv
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.s.GormTokenStorageService - Finding token nle37eh3dl7hnu1fnge4al46ttcoavnv in GORM
14.03.2018 12:03:22.889 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.s.GormTokenStorageService - Searching in GORM for UserDetails of token nle37eh3dl7hnu1fnge4al46ttcoavnv
14.03.2018 12:03:22.912 [http-nio-8080-exec-14] DEBUG g.p.s.r.RestTokenValidationFilter - Authentication failed: User not found
14.03.2018 12:03:22.927 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Looking for bearer token in Authorization header, query string or Form-Encoded body parameter
14.03.2018 12:03:22.927 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Found bearer token in Authorization header
14.03.2018 12:03:22.927 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Token: nle37eh3dl7hnu1fnge4al46ttcoavnv
14.03.2018 12:03:22.928 [http-nio-8080-exec-14] DEBUG g.p.s.r.t.b.BearerTokenAuthenticationFailureHandler - Sending status code 401 and header WWW-Authenticate: Bearer error="invalid_token"
14.03.2018 12:03:22.928 [http-nio-8080-exec-14] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
14.03.2018 12:03:22.928 [http-nio-8080-exec-14] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Request '/api/login' matched by universal pattern '/**'
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 1 of 12 in additional filter chain; firing Filter: 'SecurityRequestHolderFilter'
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No HttpSession currently exists
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 3 of 12 in additional filter chain; firing Filter: 'MutableLogoutFilter'
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/api/login'; against '/logoff'
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 4 of 12 in additional filter chain; firing Filter: 'GrailsUsernamePasswordAuthenticationFilter'
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG o.s.security.web.FilterChainProxy - /api/login at position 5 of 12 in additional filter chain; firing Filter: 'RestAuthenticationFilter'
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG g.p.s.rest.RestAuthenticationFilter - Actual URI is /api/login; endpoint URL is /api/login
14.03.2018 12:03:26.108 [http-nio-8080-exec-9] DEBUG g.p.s.rest.RestAuthenticationFilter - Applying authentication filter to this request
14.03.2018 12:03:26.109 [http-nio-8080-exec-9] DEBUG g.p.s.r.c.DefaultJsonPayloadCredentialsExtractor - Extracted credentials from JSON payload. Username: , password: [PROTECTED]
14.03.2018 12:03:26.109 [http-nio-8080-exec-9] DEBUG g.p.s.rest.RestAuthenticationFilter - Trying to authenticate the request
14.03.2018 12:03:26.109 [http-nio-8080-exec-9] DEBUG o.s.s.a.ProviderManager - Authentication attempt using org.springframework.security.authentication.dao.DaoAuthenticationProvider
14.03.2018 12:03:26.223 [http-nio-8080-exec-9] DEBUG o.s.s.a.h.RoleHierarchyImpl - getReachableGrantedAuthorities() - From the roles [ROLE_ADMIN] one can reach [ROLE_ADMIN] in zero or more steps.
14.03.2018 12:03:26.223 [http-nio-8080-exec-9] DEBUG g.p.s.rest.RestAuthenticationFilter - Request authenticated. Storing the authentication result in the security context
14.03.2018 12:03:26.223 [http-nio-8080-exec-9] DEBUG g.p.s.rest.RestAuthenticationFilter - Authentication result: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@f0f156db: Principal: grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff8868: RemoteIpAddress: ; SessionId: null; Granted Authorities: ROLE_ADMIN
14.03.2018 12:03:26.224 [http-nio-8080-exec-9] DEBUG g.p.s.rest.RestAuthenticationFilter - Generated token: grails.plugin.springsecurity.rest.token.AccessToken(accessToken:aqnlq9hiqhbb57usl4p3is7d9eaqnt5u, expiration:null, refreshToken:null, principal:grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN, super:grails.plugin.springsecurity.rest.token.AccessToken@f0edeb3: Principal: grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN; Credentials: [PROTECTED]; Authenticated: true; Details: null; Granted Authorities: ROLE_ADMIN)
14.03.2018 12:03:26.224 [http-nio-8080-exec-9] DEBUG g.p.s.r.t.s.GormTokenStorageService - Storing principal for token: aqnlq9hiqhbb57usl4p3is7d9eaqnt5u
14.03.2018 12:03:26.224 [http-nio-8080-exec-9] DEBUG g.p.s.r.t.s.GormTokenStorageService - Principal: grails.plugin.springsecurity.userdetails.GrailsUser@4fad1751: Username: ; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_ADMIN
14.03.2018 12:03:26.250 [http-nio-8080-exec-9] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - The HttpSession is currently null, and the HttpSessionSecurityContextRepository is prohibited from creating an HttpSession (because the allowSessionCreation property is false) - SecurityContext thus not stored for next request
14.03.2018 12:03:26.250 [http-nio-8080-exec-9] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Request '/api/userapi/getconfig' matched by universal pattern '/**'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 1 of 12 in additional filter chain; firing Filter: 'SecurityRequestHolderFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 2 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No HttpSession currently exists
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - No SecurityContext was available from the HttpSession: null. A new one will be created.
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 3 of 12 in additional filter chain; firing Filter: 'MutableLogoutFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.s.w.u.m.AntPathRequestMatcher - Checking match of request : '/api/userapi/getconfig'; against '/logoff'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 4 of 12 in additional filter chain; firing Filter: 'GrailsUsernamePasswordAuthenticationFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 5 of 12 in additional filter chain; firing Filter: 'RestAuthenticationFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG g.p.s.rest.RestAuthenticationFilter - Actual URI is /api/userAPI/getConfig; endpoint URL is /api/login
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 6 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 7 of 12 in additional filter chain; firing Filter: 'GrailsRememberMeAuthenticationFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 8 of 12 in additional filter chain; firing Filter: 'GrailsAnonymousAuthenticationFilter'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG g.p.s.w.f.GrailsAnonymousAuthenticationFilter - Populated SecurityContextHolder with anonymous token: 'grails.plugin.springsecurity.authentication.GrailsAnonymousAuthenticationToken@f23b2e68: Principal: org.springframework.security.core.userdetails.User@dc730200: Username: __grails.anonymous.user__; Password: [PROTECTED]; Enabled: false; AccountNonExpired: false; credentialsNonExpired: false; AccountNonLocked: false; Granted Authorities: ROLE_ANONYMOUS; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@ffff8868: RemoteIpAddress: ; SessionId: null; Granted Authorities: ROLE_ANONYMOUS'
14.03.2018 12:03:26.450 [http-nio-8080-exec-15] DEBUG o.s.security.web.FilterChainProxy - /api/userAPI/getConfig at position 9 of 12 in additional filter chain; firing Filter: 'RestTokenValidationFilter'
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Looking for bearer token in Authorization header, query string or Form-Encoded body parameter
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Found bearer token in Authorization header
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Token: aqnlq9hiqhbb57usl4p3is7d9eaqnt5u
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.RestTokenValidationFilter - Token found: aqnlq9hiqhbb57usl4p3is7d9eaqnt5u
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.RestTokenValidationFilter - Trying to authenticate the token
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.RestAuthenticationProvider - Use JWT: false
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.RestAuthenticationProvider - Trying to validate token aqnlq9hiqhbb57usl4p3is7d9eaqnt5u
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.s.GormTokenStorageService - Finding token aqnlq9hiqhbb57usl4p3is7d9eaqnt5u in GORM
14.03.2018 12:03:26.451 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.s.GormTokenStorageService - Searching in GORM for UserDetails of token aqnlq9hiqhbb57usl4p3is7d9eaqnt5u
14.03.2018 12:03:26.455 [http-nio-8080-exec-15] DEBUG g.p.s.r.RestTokenValidationFilter - Authentication failed: User not found
14.03.2018 12:03:26.459 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Looking for bearer token in Authorization header, query string or Form-Encoded body parameter
14.03.2018 12:03:26.459 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Found bearer token in Authorization header
14.03.2018 12:03:26.460 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.bearer.BearerTokenReader - Token: aqnlq9hiqhbb57usl4p3is7d9eaqnt5u
14.03.2018 12:03:26.460 [http-nio-8080-exec-15] DEBUG g.p.s.r.t.b.BearerTokenAuthenticationFailureHandler - Sending status code 401 and header WWW-Authenticate: Bearer error="invalid_token"
14.03.2018 12:03:26.460 [http-nio-8080-exec-15] DEBUG o.s.s.w.c.HttpSessionSecurityContextRepository - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
14.03.2018 12:03:26.460 [http-nio-8080-exec-15] DEBUG o.s.s.w.c.SecurityContextPersistenceFilter - SecurityContextHolder now cleared, as request processing completed

0 个答案:

没有答案