Announcement

Collapse
No announcement yet.

Spring security tutorial fehler

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring security tutorial fehler

    hallo zusammen,

    ich versuche gerade das spring tutorial

    http://howtodoinjava.com/2013/04/16/...urity-example/

    nachzubauen. wenn ich localhost:8080/index aufrufe, sehe ich, dass die url auf localhost:8080/login geändert wird, bekomme da aber nur als meldung:
    Code:
    HTTP Status 404 - Not Found
    
    type Status report
    
    messageNot Found
    
    descriptionThe requested resource is not available.
    im server log steht:
    Code:
    INFO:   16:15:34,551 DEBUG FilterChainProxy:337 - /index.htm at position 2 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
    INFO:   16:15:34,560 DEBUG FilterChainProxy:337 - /index.htm at position 3 of 11 in additional filter chain; firing Filter: 'LogoutFilter'
    INFO:   16:15:34,562 DEBUG FilterChainProxy:337 - /index.htm at position 4 of 11 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'
    INFO:   16:15:34,562 DEBUG FilterChainProxy:337 - /index.htm at position 5 of 11 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
    INFO:   16:15:34,567 DEBUG FilterChainProxy:337 - /index.htm at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
    INFO:   16:15:34,568 DEBUG DefaultSavedRequest:309 - pathInfo: both null (property equals)
    INFO:   16:15:34,569 DEBUG DefaultSavedRequest:309 - queryString: both null (property equals)
    INFO:   16:15:34,570 DEBUG DefaultSavedRequest:331 - requestURI: arg1=/list; arg2=/index.htm (property not equals)
    INFO:   16:15:34,570 DEBUG HttpSessionRequestCache:75 - saved request doesn't match
    INFO:   16:15:34,570 DEBUG FilterChainProxy:337 - /index.htm at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
    INFO:   16:15:34,597 DEBUG FilterChainProxy:337 - /index.htm at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
    INFO:   16:15:34,604 DEBUG AnonymousAuthenticationFilter:102 - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9056f12c: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@380f4: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: f522028cc3db208d47a871d83b0a; Granted Authorities: ROLE_ANONYMOUS'
    INFO:   16:15:34,605 DEBUG FilterChainProxy:337 - /index.htm at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'
    INFO:   16:15:34,605 DEBUG FilterChainProxy:337 - /index.htm at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
    INFO:   16:15:34,605 DEBUG FilterChainProxy:337 - /index.htm at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
    INFO:   16:15:34,607 DEBUG AntPathRequestMatcher:116 - Checking match of request : '/index.htm'; against '/login'
    INFO:   16:15:34,608 DEBUG AntPathRequestMatcher:116 - Checking match of request : '/index.htm'; against '/logout'
    INFO:   16:15:34,608 DEBUG AntPathRequestMatcher:116 - Checking match of request : '/index.htm'; against '/accessdenied'
    INFO:   16:15:34,609 DEBUG FilterSecurityInterceptor:194 - Secure object: FilterInvocation: URL: /index.htm; Attributes: [hasRole('ROLE_USER')]
    INFO:   16:15:34,610 DEBUG FilterSecurityInterceptor:310 - Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@9056f12c: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@380f4: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: f522028cc3db208d47a871d83b0a; Granted Authorities: ROLE_ANONYMOUS
    INFO:   16:15:34,667 DEBUG AffirmativeBased:65 - Voter: org.springframework.security.web.access.expression.WebExpressionVoter@189c837, returned: -1
    INFO:   16:15:34,687 DEBUG ExceptionTranslationFilter:165 - Access is denied (user is anonymous); redirecting to authentication entry point
    org.springframework.security.access.AccessDeniedException: Access is denied
    	at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:83)
    	at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:206)
    ....
    INFO:   16:15:34,700 DEBUG HttpSessionRequestCache:41 - DefaultSavedRequest added to Session: DefaultSavedRequest[http://localhost:8080/index.htm]
    INFO:   16:15:34,700 DEBUG ExceptionTranslationFilter:185 - Calling Authentication entry point.
    INFO:   16:15:34,704 DEBUG DefaultRedirectStrategy:36 - Redirecting to 'http://localhost:8080/login'
    INFO:   16:15:34,705 DEBUG HttpSessionSecurityContextRepository:300 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
    INFO:   16:15:34,705 DEBUG SecurityContextPersistenceFilter:97 - SecurityContextHolder now cleared, as request processing completed
    INFO:   16:15:34,718 DEBUG FilterChainProxy:337 - /login at position 1 of 11 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter'
    INFO:   16:15:34,719 DEBUG HttpSessionSecurityContextRepository:148 - HttpSession returned null object for SPRING_SECURITY_CONTEXT
    INFO:   16:15:34,720 DEBUG HttpSessionSecurityContextRepository:90 - No SecurityContext was available from the HttpSession: org.apache.catalina.session.StandardSessionFacade@c2dead. A new one will be created.
    INFO:   16:15:34,720 DEBUG FilterChainProxy:337 - /login at position 2 of 11 in additional filter chain; firing Filter: 'WebAsyncManagerIntegrationFilter'
    INFO:   16:15:34,720 DEBUG FilterChainProxy:337 - /login at position 3 of 11 in additional filter chain; firing Filter: 'LogoutFilter'
    INFO:   16:15:34,721 DEBUG FilterChainProxy:337 - /login at position 4 of 11 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter'
    INFO:   16:15:34,721 DEBUG FilterChainProxy:337 - /login at position 5 of 11 in additional filter chain; firing Filter: 'BasicAuthenticationFilter'
    INFO:   16:15:34,722 DEBUG FilterChainProxy:337 - /login at position 6 of 11 in additional filter chain; firing Filter: 'RequestCacheAwareFilter'
    INFO:   16:15:34,722 DEBUG DefaultSavedRequest:309 - pathInfo: both null (property equals)
    INFO:   16:15:34,722 DEBUG DefaultSavedRequest:309 - queryString: both null (property equals)
    INFO:   16:15:34,722 DEBUG DefaultSavedRequest:331 - requestURI: arg1=/index.htm; arg2=/login (property not equals)
    INFO:   16:15:34,722 DEBUG HttpSessionRequestCache:75 - saved request doesn't match
    INFO:   16:15:34,722 DEBUG FilterChainProxy:337 - /login at position 7 of 11 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter'
    INFO:   16:15:34,722 DEBUG FilterChainProxy:337 - /login at position 8 of 11 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter'
    INFO:   16:15:34,722 DEBUG AnonymousAuthenticationFilter:102 - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9056f12c: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@380f4: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: f522028cc3db208d47a871d83b0a; Granted Authorities: ROLE_ANONYMOUS'
    INFO:   16:15:34,724 DEBUG FilterChainProxy:337 - /login at position 9 of 11 in additional filter chain; firing Filter: 'SessionManagementFilter'
    INFO:   16:15:34,724 DEBUG FilterChainProxy:337 - /login at position 10 of 11 in additional filter chain; firing Filter: 'ExceptionTranslationFilter'
    INFO:   16:15:34,724 DEBUG FilterChainProxy:337 - /login at position 11 of 11 in additional filter chain; firing Filter: 'FilterSecurityInterceptor'
    INFO:   16:15:34,724 DEBUG AntPathRequestMatcher:116 - Checking match of request : '/login'; against '/login'
    INFO:   16:15:34,725 DEBUG FilterSecurityInterceptor:194 - Secure object: FilterInvocation: URL: /login; Attributes: [permitAll]
    INFO:   16:15:34,725 DEBUG FilterSecurityInterceptor:310 - Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@9056f12c: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@380f4: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: f522028cc3db208d47a871d83b0a; Granted Authorities: ROLE_ANONYMOUS
    INFO:   16:15:34,726 DEBUG AffirmativeBased:65 - Voter: org.springframework.security.web.access.expression.WebExpressionVoter@189c837, returned: 1
    INFO:   16:15:34,726 DEBUG FilterSecurityInterceptor:215 - Authorization successful
    INFO:   16:15:34,726 DEBUG FilterSecurityInterceptor:227 - RunAsManager did not change Authentication object
    INFO:   16:15:34,734 DEBUG FilterChainProxy:323 - /login reached end of additional filter chain; proceeding with original chain
    INFO:   16:15:34,742 DEBUG HttpSessionSecurityContextRepository:300 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
    INFO:   16:15:34,742 DEBUG ExceptionTranslationFilter:115 - Chain processed normally
    INFO:   16:15:34,742 DEBUG SecurityContextPersistenceFilter:97 - SecurityContextHolder now cleared, as request processing completed
    kann mir jemand sagen, was ich bei der hitze falsch mache? Danke.

  • #2
    wenn ich localhost:8080/index aufrufe
    lt. Tutorial sollte es

    1) Type the URL in browser “http://localhost:8080/Spring3HibernateIntegration”

    sein
    Christian

    Comment


    • #3
      daran sollte es eigentlich nicht liegen, da im code selbst dies nicht definiert ist. Spring3HibernateIntegration ist aus meiner sicht nur der maven deployment ordner im tomcat/glassfish und somit ne abkürzung für Spring3HibernateIntegration/index(.jsp? oder .htm oder nix?). da bei mir direkt in die wurzel deployed wird, sollte mein index stimmen. ich vermute, dass der fehler von hier kommt:

      Code:
      RunAsManager did not change Authentication object
      INFO:   16:15:34,734 DEBUG FilterChainProxy:323 - /login reached end of additional filter chain; proceeding with original chain
      INFO:   16:15:34,742 DEBUG HttpSessionSecurityContextRepository:300 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession.
      dessen bedeutung verstehe ich aber nicht.

      Comment

      Working...
      X