cancel
Showing results for 
Search instead for 
Did you mean: 

HCP - Getting Current User in Java Services

Jeetendra
Explorer
0 Kudos

We are using the java services exposed as rest to consume in our Fiori application. Application architecture looks like below -

- Maven Project

| - Maven Module for Java Services

| - Maven Module for web project exposing as rest

We want the current user in java services, now is that possible to get it using api, I understand that the service should get the login credentials in some form ( not sure ) and using the credentials one should be able to get the current user. For this the services needs to be authenticated, my question is -

  1. How to enable the authentication in services? Because these services are faceless i.e they are exposed from rest module which is a separate module, Please mind that I don't have any web xml in services module, the services module are used as dependencies in web module.
  2. If the authentication needs to be passed from web module, how do I enable the authentication in web module. I don't have servlets in web module, so no request or response object here. I do have web.xml here.

Any help or pointer would be greatly appreciated.

Best Regards

Jeet

gregorw
Active Contributor
0 Kudos

Are you using SAP Cloud Platform Neo or Cloud Foundry?

View Entire Topic
Jeetendra
Explorer
0 Kudos

ivan.mirisola : Thank you very much for the detailed answer and support, I was able to achieve the desired result with the provided help.

riley.rainey : Indeed a great help, the provided code sample helped a lot, Thank you very much.

Best Regards

Jeet