spring-boot-spring-security-jwt-authentication icon indicating copy to clipboard operation
spring-boot-spring-security-jwt-authentication copied to clipboard

Role is not found

Open Rajveer9575 opened this issue 4 years ago • 6 comments

com.bezkoder.springjwt.controllers.AuthController.lambda$1(AuthController.java:99)

Rajveer9575 avatar Jul 16 '21 06:07 Rajveer9575

I have the same Issue??

arifdemircan avatar Apr 07 '22 03:04 arifdemircan

Please let me know if you have a Solution?

arifdemircan avatar Apr 07 '22 03:04 arifdemircan

Thank you for you advances :)

arifdemircan avatar Apr 07 '22 03:04 arifdemircan

@Rajveer9575 @arifdemircan you can check my updated repo, I solved some problems including "Role not found" and also I dockerized the all app and refactored.

https://github.com/ramazansakin/spring-boot-spring-security-jwt-authentication

ramazansakin avatar Apr 08 '23 08:04 ramazansakin

I am having an issue. When registering all users are getting assigned ROLE_USER no matter what I use. I am using Postman to test API.

v1shaL-b avatar Apr 27 '23 11:04 v1shaL-b

Hi @v1shaL-b , You can try to sign up with body like : { "username" : "rmzn", "email" : "[email protected]", "password" : "1234567", "roles" : [ "admin" ] }

After succesfully registration then sign in ll be returned like: { "token": "eyJhbGciOiJIUzUxMiJxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "type": "Bearer", "id": 1, "username": "rmzn", "email": "[email protected]", "roles": [ "ROLE_ADMIN" ] }

It's an admin user, you can check it on TestController. If you have a problem on this repo, you can check mine : https://github.com/ramazansakin/spring-boot-spring-security-jwt-authentication

ramazansakin avatar Jun 02 '23 05:06 ramazansakin