SAP Builders Discussions
Join the discussion -- ask questions and discuss how you and fellow SAP Builders are using SAP Build, SAP Build Apps, SAP Build Process Automation, and SAP Build Work Zone.
cancel
Showing results for 
Search instead for 
Did you mean: 

Build Apps and OData with authentication

Jakub_Roguski
Product and Topic Expert
Product and Topic Expert
2,796

Hello, Experts,

Citizen developer here 🙂

And urgently needing help 🙂

Could someone guide me please, how to connect my Build Apps web app to the SAP HANA Cloud OData WITH authentication?

- HANA Cloud schema and tables and data - done

- HANA Cloud OData interface WITHOUT authentication - done

- Connection of Build Apps web app to HANA Cloud OData interface WITHOUT authentication - done

- HANA Cloud OData NEW interface WITH authentication - done

- Connection of Build Apps web app to HANA Cloud OData interface WITH authentication - no idea how to do it 😞

Is there a documentation about it? I tried to adopt solution I found in the blog about connecting Build Apps application to a Build Process Automation process, but there is not enough details for a "citizen developer" to be able to do it without help.

Best regards

Jakub

9 REPLIES 9

RichDBlumberg
Participant
2,782

@Jakub_Roguski Great timing! I'm putting the final touches on a blog that will address many of your questions. I agree... us Citizen Developers need easy, step-by-step instructions that work and help build skills and confidence. I'll publish it soon... in the next week. Just need to record a short video and then it will be ready.  Look forward to your feedback. I will let this group know where to find it in the SAP Community!

Jakub_Roguski
Product and Topic Expert
Product and Topic Expert
2,781

Great news! Any chance to see your blog preview still this week, as next week we will have a huge conference, where your blog content could be a game changer? 🙂

2,779

Hi! Jacub... that's exciting that you share in the value of doing these steps as a Citizen Developer (business practitioner)... The developers, pro-coders, and software developers are awesome. We business people need their insights, expertise, and guidance (I received some excellent help when I hit roadblocks...

Let's schedule some time off-line... I'll send you an email... I plan to walk 2 of my team membes through these steps... Happy to include you... I'm ready to publish....Just need to record a short video to make it even easier!:-)

Dan_Wroblewski
Developer Advocate
Developer Advocate
0 Kudos
2,736

Welcome to the group. 

Is your HANA service authentication Basic Authentication (user name and password)? Can you successful test it in the Browser/Postman?  




--------------
See all my blogs and connect with me on Twitter / LinkedIn

Jakub_Roguski
Product and Topic Expert
Product and Topic Expert
0 Kudos
2,723

Hi Dan,

My HANA Cloud uses oauth2 token authentication. It is a standard OData interface service, generated by the SAP HANA Academy, hanaacademy-cap generator in the Business Application Studio and deployed in CF space in the HANA Cloud subaccount.

Yes, I can successfully access HANA OData using Postman (or actually Insomnia, as I received a notice from SAP not to use Postman any more).

1. I get the token, calling the /oauth/token service

2. I use the token as authentication in Insomnia - call to the OData service returns "200 OK".

3. When I copy the token from Insomnia and use it to test the OData source, I get confirmation that the source is valid OData interface, but then I have no idea how to get and use token in Build Apps.

Best regards

Jakub

2,700

You should make sure your URL points to the OData service document -- not to higher level to the system, and not to a lower level to a specific entity




--------------
See all my blogs and connect with me on Twitter / LinkedIn

Dan_Wroblewski
Developer Advocate
Developer Advocate
2,733

In case this helps, generally, you would do it this way:

  1. Create a destination in the BTP cockpit to your service. Here is an example using the free ES5 OData service with a technical user. There are many ways to authenticate, and this depends on your setup. dan_wroblewski_0-1696307058898.png
  2. In SAP Build Apps, you would enable BTP authentication (Auth tab)dan_wroblewski_1-1696307127294.png
  3. In the Data tab, you would go to Add Integration → BTP Destinations, and then you would select the destination and the entities you want. dan_wroblewski_2-1696307252995.png
  4. You create a a data variable for your entity.
  5. You specify this variable as Repeat for any UI widget (this assumes you are just displaying a list).

And that's it. You will now see the list from your entity.

dan_wroblewski_3-1696307429332.png

All this makes assumptions of the OData data you want to display, and that you are using a technical user (you could also provide a login screen for user basic authentication, or you could have some sort OAuth or BTP authentication). Also assumes basic knowledge of SAP Build Apps, but let us know if you have questions about that.

 




--------------
See all my blogs and connect with me on Twitter / LinkedIn

2,639

Thank you for this blog. I 

0 Kudos
2,469

Hi Dan,

I tried the same settings as per your blog and trying to connect my SAP Public Cloud System. I have added the system on my BTP account as destinations, I have added the required properties , but still I see a 302 error in Build when I want to select the destination and the data entity are not displayed as in your blog. Any idea what could be causing it?