How to capture user details from Java SpringBoot application being behind the App Proxy

Kamlesh Pradhan 0 Reputation points
2024-05-17T15:41:17.2266667+00:00

Hi Team,

I have a Java SpringBoot/Tomcat 10.1 application running on Azure App Service configured to spin up docker containers. The application sits behind the App Proxy and no Authentication has been enabled from App Service. The authentication is done by the App Proxy after users launch the application URL from the browser and users are redirected to the home page of the application upon successful log on.

I want to now capture the logged in users' details from my application code. But, I found no details when parsed the authentication header as below -

@RequestMapping("/")
public String home(HttpServletRequest request) {
    String authToken = request.getHeader("Authorization");
    if (authToken != null && authToken.startsWith("Bearer ")) {
        String token = authToken.substring(7);
        LOGGER.info("Auth Token - " + token);
    } else {
        LOGGER.info("Authentication token not found");
    }
    return "thym/ss_home";
}

It looks like the backend application has no authentication details being passed from the app proxy which apparently doesn't have a option to enable this feature. Please could you help me on how to capture the user details so that I can show the name on the home page or how to make the app proxy send the details to the backend app? Thanks in advance.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,099 questions
{count} votes