cancel
Showing results for 
Search instead for 
Did you mean: 

Spring security html

mattxiang
Explorer
0 Kudos

I add 'xsuaa-spring-boot-starter' dependency to my springboot application, and i put a html file to the classpath,  and then when i started the application and access the html, the html code is displayed without being rendered, and i found source file on chrome, it displayed html code with wrong format. And when i remove the 'xsuaa-spring-boot-starter' dependency, it rendered success. Please give me some help, many thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi @mattxiang,

It is really hard to understand what's wrong without ever looking at the project.

Take a look at bot my projects:

https://github.com/ivanmir/cct-ts-connector.git

https://github.com/ivanmir/cct-approuter.git

NOTE: Please read very carefully the comments on my pom.xml - as newer implementations of Spring Boot aren't really compatible yet with SAP's Java Buildpack. If you really want Spring Boot 3.x, it requires modern Java version AND Tomcat 10 (which is not available on SAP Java Build pack). Hence, you must use the Cloud Foundry Build Pack - which does feature this version combination.

The static HTML files in my project are stored on SAP App Router since this is going to be the central access point for any secured and unsecured end-points. SAP App Router is the application responsible for emitting the JWT that can be forwarded to services implemented in Spring Boot. That's why you cannot place it inside the Spring Boot itself. Usually if you implemented any API's using Spring Boot, it should accept only JWT for OAuth2 clients (created via Service Key on your XSUAA) or those that are emitted by a SAP App Router. 

Hope this helps.

Best regards,
Ivan