jhipster / jhipster-registry

JHipster Registry, based on Spring Cloud Netflix Eureka and Spring Cloud Config
Apache License 2.0
698 stars 657 forks source link

Refreshing or direct navigation returns error page #416

Closed ruddell closed 4 years ago

ruddell commented 4 years ago
Overview of the issue

Refreshing any page (except the home path /) results in a 401 error. You also can not directly navigate to a page such as http://localhost:8761/registry/config

Motivation for or Use Case

Refreshing and navigating directly to pages should work as expected

Reproduce the error

Start the registry with the default configuration (locally or via docker) and try to directly navigate to http://localhost:8761/registry/config

Suggest a Fix

There is a slight difference in a generated JHipster security configuration and the JHipster Registry security configuration. If I remove I remove the two lines from the link below, it works as expected. I wasn't sure if there was a reason for the different configurations.

https://github.com/jhipster/jhipster-registry/blob/01873cdd6c95b2a723f3bdec3bec6ae08a118a47/src/main/java/io/github/jhipster/registry/config/JWTSecurityConfiguration.java#L134-L135

JHipster Registry Version(s)

Only tested latest release (v6.0.2) and master

Browsers and Operating System

Server-side issue

pascalgrimaud commented 4 years ago

cc @juliensadaoui What do you think ? Can you have a look on this plz ?

juliensadaoui commented 4 years ago

Refreshing or direct navigation works with OAuth profile. There is an incoherence between JWT and OAuth2 security configuration, these two configurations must be identical. I think that the reason was to secure all URLs by default.