Git Product home page Git Product logo

Comments (5)

MaheshIare avatar MaheshIare commented on August 12, 2024

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.

Sanskar49 avatar Sanskar49 commented on August 12, 2024

@MaheshIare have you by any chance done it with mySql or PostGresSql and not h2-in-memory-databse??

from spring-security-jwt.

MaheshIare avatar MaheshIare commented on August 12, 2024

@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.

Sanskar49 avatar Sanskar49 commented on August 12, 2024

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.

AkhilKoilada avatar AkhilKoilada commented on August 12, 2024

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.