Skip to Content
Author's profile photo Paul Todd

Reading the user info from an external application

This may not be the approved way as I have yet to find an approved way to do this so if anyone has a better way please leave it in the comments.

In the previous application we created a simple application to display the user details using the userapi REST service in HCP.

https://scn.sap.com/blogs/pault/2016/05/23/getting-user-details-in-ui5-hcp

To start with, we take the exercise that was completed in the previous blog and publish it as an HCPms app.

Right click over the application root node and choose “Deploy” from the context menu. Select the “Deploy to SAP HANA Cloud Platform”

/wp-content/uploads/2016/05/pic_960355.png

You might be prompted to enter your credentials again, if so then do it.

/wp-content/uploads/2016/05/pic_960355.png

Finally enter in the deployment info, remembering to make a note of the application name

/wp-content/uploads/2016/05/pic_960355.png

Click deploy and the application will be deployed to HANA as a new HTML application.

/wp-content/uploads/2016/05/pic_960355.png

Click on the hilited link to open the deployed application in the HCP cockpit. This will show us the URL of the application

/wp-content/uploads/2016/05/pic_960355.png

Make a note of the Application URL.

We can now test whether or not we can get the user information just from the browser. To this URL we append the string “/services/userapi/currentUser”. This URL will get the user information that be returned as a JSON object.

/wp-content/uploads/2016/05/pic_960355.png

This proves we can access your user details from a REST API. This will prove useful when we go to use this in an HCPms application in the next exercise.

If you are an experienced mobile application developer then you can guess where this is heading. We expose this API as a backend connection in HCPms and then this can be consumed as an API on the hybrid application through HCPms.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.