Develop a Microservices Architecture with JHipster and OAuth

Steve Macleod

Hi Matt,
Using JHipster v6.3.1.
I have followed the steps and configured the 2 applications to use Okta, added a test entity.
I can log in successfully (via Okta) to the gateway app. When I select the test entity in the menu, I get an ‘Internal Error’ with the following stack trace on the gateway app:

com.netflix.zuul.exception.ZuulException:
at org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter.findZuulException(SendErrorFilter.java:118)
at org.springframework.cloud.n…(SendErrorFilter.java:78)
at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:117)
at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:193)
at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:157)
at com.netflix.zuul.FilterProcessor.error(FilterProcessor.java:105)
at com.netflix.zuul.ZuulRunner.error(ZuulRunner.java:112)
at com.netflix.zuul.http.ZuulServlet.error(ZuulServlet.java:145)
at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:83)

The security config is as follows (all apps):

security:
oauth2:
client:
provider:
oidc:
issuer-uri: https://{{OKTA_DOMAIN}}/oauth2/default
registration:
oidc:
client-id: {{CLIENT_ID}}
client-secret: {{CLIENT_SECRET}}

Note that if I change the following line in SecurityConfiguration.java (microservice app), it will work:

.antMatchers("/api/").authenticated()

to

.antMatchers("/api/").permitAll()