Auth0 Home Blog Docs

Access Denied exception



I’m following the Spring Security tutorial, downloaded the preconfigured app, verified my client id, etc… and i get a access denied, but I see in the Dashboard log, a Successful Login for it. I see in the AppConfig, it expects a ROLE_ADMIN for the user. Do I need to somehow assign the role to my user that’s trying to login?

6-26 20:25:54.929 DEBUG 10431 --- [nio-3099-exec-6] o.s.s.w.u.matcher.AntPathRequestMatcher  : Checking match of request : '/portal/home'; against '/portal/**'
2017-06-26 20:25:54.929 DEBUG 10431 --- [nio-3099-exec-6] o.s.s.w.a.i.FilterSecurityInterceptor    : Secure object: FilterInvocation: URL: /portal/home; Attributes: [hasAuthority('ROLE_ADMIN')]
2017-06-26 20:25:54.929 DEBUG 10431 --- [nio-3099-exec-6] o.s.s.w.a.i.FilterSecurityInterceptor    : Previously Authenticated: Principal:; Credentials: [PROTECTED]; Authenticated: true; Details: {user_id=google-oauth2|100479163693422019999, name=Alper Akture, nickname=alper.akture,, email_verified=true, picture=, iss=, sub=google-oauth2|100479163693422019999, aud=yh1aCKMf0-LTaYtNyz5M4pRUlwXCfhEJ, exp=1498569802, iat=1498533802}; Not granted any authorities
2017-06-26 20:25:54.929 DEBUG 10431 --- [nio-3099-exec-6]       : Voter:, returned: -1
2017-06-26 20:25:54.930 DEBUG 10431 --- [nio-3099-exec-6] o.s.b.a.audit.listener.AuditListener     : AuditEvent [timestamp=Mon Jun 26 20:25:54 PDT 2017,, type=AUTHORIZATION_FAILURE, data={, message=Access is denied}]
2017-06-26 20:25:54.934 DEBUG 10431 --- [nio-3099-exec-6] o.s.s.w.a.ExceptionTranslationFilter     : Access is denied (user is not anonymous); delegating to AccessDeniedHandler Access is denied
	at ~[spring-security-core-4.0.4.RELEASE.jar:4.0.4.RELEASE]