raphaelDL / spring-webflux-security-jwt

A JWT authorization and authentication implementation with Spring Reactive Webflux, Spring Boot 2 and Spring Security 5
301 stars 87 forks source link

Fixed possible NullPointerException #3

Closed krisztian-toth closed 2 years ago

krisztian-toth commented 6 years ago

If there is no Authorization header set, then a NPE is thrown. Fixed that

petivagyok16 commented 6 years ago

I tried to implement this into my app, but keep getting this error:

***************************
APPLICATION FAILED TO START
***************************

Description:

A component required a bean of type 'org.springframework.security.config.annotation.ObjectPostProcessor' that could not be found.

Action:

Consider defining a bean of type 'org.springframework.security.config.annotation.ObjectPostProcessor' in your configuration.

Any idea?

You can check my repo here

krisztian-toth commented 6 years ago

hi @petivagyok16,

the problem will be with one of your dependencies. I just changed them to the original pom.xml with lombok and mongo, and it builds. my educated guess would be a problem with embedded-mongo, i have had problem with that before.

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.auth0</groupId>
            <artifactId>java-jwt</artifactId>
            <version>3.3.0</version>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.20</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-mongodb-reactive</artifactId>
            <version>2.0.1.RELEASE</version>
        </dependency>
    </dependencies>

sok szerencset, nagyon keves mindent talalni spring-webflux-security-rol a neten, ugyhogy nem is nagyon foglalkoztam vele ennel tobbet. :)

Good luck!