Cannot access api-docs of microservice, spring boot - spring-boot

I basically have the exact same problem as this user's question:
Cannot access api-docs of microservice from spring cloud gateway. Failed to load API definition
Any help is appreciated.

I answered in the post that you mention.
Try to follow my solution: https://stackoverflow.com/a/71996847/18936800

Related

Separate spring authenticator server from resource

i m new with spring security.
I want to know if it's possible to have jwt authentication server separate from resource server,
If possible i need a working example.
Thanks!
You could find an example with Oauth2 and Spring Boot 2.1.9.RELEASE here:
https://github.com/buddhiprab/springboot-oauth2-separating-authorization_server-and-resource_server
All the explanation of this example is here: https://medium.com/#buddhiprabhath/spring-boot-oauth-2-0-separating-authorization-service-and-resource-service-1641ebced1f0
This is doing with the client-credentials flow from OAuth2.
Here is another example using password flow:
https://www.javainuse.com/spring/springboot-oauth2-password-grant
Here's an example that shows a separate auth and resource server. This is from Joe Grandja, who is one of the primary authors of Spring Security:
Old way; Spring Security version 5.1 or earlier with separate spring-security-oauth library: https://github.com/jgrandja/spring-security-oauth-2-4-migrate
New way; Spring Security 5.2+: https://github.com/jgrandja/spring-security-oauth-5-2-migrate
Thank`s everyone! i start to understand how it works! i want to integrate jwt now!

How connect Spring Cloud Gateway + Spring Cloud Security + Keycloak

He has been trying to connect s-c-gateway and s-c-security with Keycloak for a couple of days. I want the modules that are located behind the gateway not to have a keycloak configuration.
Is Spring Cloud Gateway not supported by Spring Cloud Security?
There's an issue on the spring cloud gateway github about this - a short summary is that there's currently no official support but I'd suggest reading the full github comments
You could use #EnableWebFluxSecurity in cloud gateway, since it's reactive project.
I know this is an old question with an answer but now it is possible and very common to integrate Spring cloud Gateway, Spring cloud Security and Keycloak. You can find a good tutorial here:
https://kunkkali.blogspot.com/2020/10/build-j2ee-micro-services-architecture.html
Source code: https://github.com/liqili/spring-microservice-oauth2-keycloak-starter

Accessing localhost:8080/actuator endpoint (with spring boot actuator)

In spring docs I have read about endpoint named "actuator" which is provided by actuator dependency, but I haven't managed to access it on my local testing app.
Question: Does someone know how to access that endpoint? of coarse if it is possible :)
Sub-question 1: If this endpoint exists, then why it is hidden?
Sub-question 2: If this endpoint doesn't exist, how can we notify spring.io to correct documentation page (open some kind of ticket) ?
Details:
I want to access exactly "actuator" endpoint, not other endpoints provided by spring boot actuator (localhost:8080/actuator)
Yes, I have tried to enable that endpoint manually in properties file (endpoints.enabled=true OR endpoints.actuator.enabled=true)
Yes, I have tried to enable/disable endpoints.sencitive property
Yes, other endpoints of actuator work just fine
No special reason why I need that, just want to try it out (just learning new stuff :) )
Please don't just answer "there is no such endpoint dude!", there should be some kind of reason why it is written in the docs
Please use spring boot version which I am using now before answering "it is working for me with these configs" (spring boot version: 1.5.4.RELEASE)
Thank you in advance :)
You must include the Spring Hateoas dependency in order for the /actuator endpoint to become available:
<dependency>
<groupId>org.springframework.hateoas</groupId>
<artifactId>spring-hateoas</artifactId>
</dependency>
Per the docs:
Provides a hypermedia-based “discovery page” for the other endpoints.
Requires Spring HATEOAS to be on the classpath.

Jhipster Microservice and Hystrix

I have created a Microservice with JHipster and I want to add hystrix, but I have a problem.
I had #EnableHystrix on my ServiceApp.java, and #HystrixCommand on method #RequestMapping.
But when I want to access on http://localhost:8081/hystrix.stream (it's the good port), I get this page:
Your request cannot be processed
I do not know from where it comes, security problem, but I can't solve it successfully.
Thanks for your help. Sorry for my bad english.
Jhipster sets by default the actuator property management.context-path to /management
So your hystrix stream should be available at http://localhost:8081/management/hystrix.stream

Spring XD REST Service

I would like to have a REST service to expose the data read and processed from Spring XD. Similar to the one in the Analytics Server.
For example I would like my own functions which can be exposed similar to Counters and be able to access the data from a web browser.
Is there any tutorial? I have searched and found that Spring Boot is the one but I am looking for help on how I integrate it with Spring XD.
Would be very helpful if someone can point me to the instructions on how I can achieve this.
You can use trigger as a source with http-client as a processor processor to access any web browsers info regardless if it is a web service URL or not.
Moha.

Resources