Code Monkey home page Code Monkey logo

spring-security-jpa's Introduction

spring-security-jpa

How to implement spring security connecting with database

spring-security-jpa's People

Contributors

basahota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spring-security-jpa's Issues

Getting HTTP 403 when trying to add new user

spring-security-jpa.zip

Hello,

I am getting a HTTP 403 when trying to add a new user after adding the url authorization rules. I have configured it the same as you mentioned in the youtube video and in this repository. Can you please let me know what could be the issue. I am attaching the code I am using as well.

authentication issue

thank for video .

I have implemented with spring 5.

return user.getRoles().stream().map(role -> new SimpleGrantedAuthority(""+role))
.collect(Collectors.toList());
the hight light work for me. why not ROLE_ADMIN or ROLE_USER

@PreAuthorize("hasAnyRole('ADMIN')") not working

setUser() in custom user detail class is not available

I Have checked your code an unable to figure out, how you have set userDetails object to user object in "CustomUserDetailsService" class . Since there is no such "setUser"method defined in "CustomUserDetails" class.

Can't configure antMatchers after anyRequest

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.csrf().disable();
    http.authorizeRequests()
            .antMatchers("/rest/**").authenticated()
            .anyRequest().permitAll()
            .and()
            .authorizeRequests()
            .antMatchers("/secure/**").authenticated()
            .anyRequest().hasAnyRole("ADMIN")
            .and()
            .formLogin().permitAll();
}

@basahota Above is my configure overriden methd.
Still I am getting below mentioned error:

  1. Can't configure antMatchers after anyRequest.

  2. Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception;

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.