Skip to Content
0
Feb 14, 2019 at 11:34 AM

Getting username from a Spring Boot application deployed to HCP Tomcat 8

275 Views Last edit Feb 14, 2019 at 11:36 AM 2 rev

Hello Experts,

I've a Spring Boot application deployed to HCP Tomcat 8.
I'm trying the get the authenticated user name:
request.getUserPrincipal().getName() but request.getUserPrincipal() is null.

I tried adding

 <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-security</artifactId>
</dependency>

Local Tomcat works but the app is "hanging" ('starting' and then fails) when trying to start it in the cloud (I can deploy it but not start it).

I'm expecting that the HCP runtime Tomcat will get the username from SAP Identity Provider.

Any experience on the right settings to get this to work?

Regards,
Omri