Comments (5)
The issue could be with the way you have implemented your security configuration. I have a working sample implemented with H2 in-memory database integration. You can go through it for reference: https://github.com/MaheshIare/spring-boot-jwt-security
from spring-security-jwt.
@MaheshIare have you by any chance done it with mySql or PostGresSql and not h2-in-memory-databse??
from spring-security-jwt.
@MaheshIare have you by any chance done it with mySql or PostGresSql and not h2-in-memory-databse??
@Sanskar49 I haven't tried with mysql or postgres. But I'm sure its pretty straightforward, needs some tweaks in the security config class though. It should work with mysql/postgre as well.
You can take a look at this example, which uses jpa abstracting the underlying database implementation. It should work with mysql as well, unless you have any authentication issues.
https://github.com/MaheshIare/spring-boot-jwt-security
Let me know once you tried.
from spring-security-jwt.
Hey @MaheshIare I did try it with postgres sql with little tweaks.. What I wanted to do was.. I did not want any roles involved for the time being meaning I was wanted simple authentication procedure.. I was planning to have a simple form in react and have a simple authentication API without any roles for the time being.. I configured it but for some reason when I hit the api and pass the request body through my postman.. It gives me a 403 unauthorized error and does not produce a JWT. My Configuration seems ok but for some reason it's not working..
from spring-security-jwt.
http.addFilterBefore(jwtRequestFilter, UsernamePasswordAuthenticationFilter.class);
Try adding the above line in the configure function(used for authorization). It worked for me this wat. I believe that the filter wasn't getting called.This line makes sure that for every request the filter gets added.
from spring-security-jwt.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-security-jwt.