0
votes

I have been trying to build a spring distributed application that works on JWT. Github repo - https://github.com/dhananjay12/spring-microservice-demo

Service Description

  • product-service : A simple downstream service having protected routes
  • jwt-resoure-server : A jar that when included in downstream services make it a rsourceserver that extract jwt token and set it in security contex.
  • eureka-service : Discovery service
  • zuul-server : Edge server

Now product-service with jwt-resoure-server , works fine: enter image description here

Setting up zuul and eureka:

enter image description here

But if I hit from the zuul server I get the following error:

enter image description here

I am using okta for authentication. I am not sure, where the error is coming from. Is it zuul not passing the token or some place else.

Any help would be appreciated. Thanks.

1

1 Answers

1
votes

I took a quick look. It looks like your gateway is NOT a ResourceServer, so it wouldn't accept an access token.

Also note, you shouldn't put secrets like (including access tokens) on GitHub or StackOverflow. I'd recommend you replace the secrets associated with this post.