daniel-cottone / Cerberus

A demonstration of a completely stateless and RESTful token-based authorization system using JSON Web Tokens (JWT) and Spring Security.
MIT License
477 stars 176 forks source link

http://localhost:8080/api/auth giving 401 #13

Closed rohit1987j closed 8 years ago

rohit1987j commented 8 years ago

hi, I have checked out the code from master branch. set up project in eclipse and then started it. i am using postman to test, when i try to hit "http://localhost:8080/api/auth" i get access denied error though I should receive jwt token as mentioned in your README.MD.

Please help if possible. I have also attached screen shot for same.

screenshot 96

ghost commented 8 years ago

Can you post the logs?

rohit1987j commented 8 years ago

2016-06-06 18:44:51.768 INFO 9904 --- [nio-8080-exec-8] o.s.b.a.audit.listener.AuditListener : AuditEvent [timestamp=Mon Jun 06 18:44:51 IST 2016, principal=anonymousUser, type=AUTHORIZATION_FAILURE, data={type=org.springframework.security.access.AccessDeniedException, message=Access is denied}]

rohit1987j commented 8 years ago

any idea?

ghost commented 8 years ago

No, I'll need to see more information. Make sure your log level is set to debug for org.springframework and then pastebin the entire log: http://pastebin.com/

On Mon, Jun 6, 2016 at 9:33 AM, rohit1987j notifications@github.com wrote:

any idea?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/brahalla/Cerberus/issues/13#issuecomment-223977036, or mute the thread https://github.com/notifications/unsubscribe/AICF0iZ83palOV_ER6bTagWKk8mGi6SBks5qJC-6gaJpZM4Iu3RH .

Daniel Cottone

rohit1987j commented 8 years ago

http://pastebin.com/m4ueqnqj

ghost commented 8 years ago

2016-06-06 20:44:10.597 INFO 10524 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring FrameworkServlet 'dispatcherServlet'

Looks like for some reason, on your machine the servlet context path specified in the properties file is not being applied. If you try sending the post request to http://localhost:8080/auth it should work for you.