How to call on-premise REST API without OpenAPI Specification using Cloud SDK Java - sap-cloud-sdk

I have one use case to call on-premise REST API via Cloud Connector. It is a custom API in SAP R/3 system. I checked with API developer and unfortunately they have no OpenAPI specification for it. Thus, I could not use OpenAPI generator to generate library.
Is there any other way to call on-premise REST API in such scenario like native call with connectivity service? We might have some more use cases with the same situation in future.
Is it possible to provide a generic REST client similar to OData?

For your use-case you could leverage our HttpClientAccessor to instantiate a HttpClient.
HttpDestination destination = DestinationAccessor.getDestination("my-destination").asHttp();
HttpClient client = HttpClientAccessor.getHttpClient(destination);
HttpResponse response = client.execute(your-http-request-here);
You can read more details here

Related

How to use Azure API connector to register an user through signin-signup user-flow from an ASP.NET Core Web API?

I want to execute the signup user-flow in Azureb2c from an ASP.NET Core Web API instead of executing it from our frontend app. To achieve this I found an approach of using API connector.
The documentation of API-Connector says
You can use API connectors to integrate your sign-up user flows with REST APIs to customize the sign-up experience and integrate with external systems
I assume with this explanation that I can execute a user-flow defined in AzureB2C for signin-signup from a Web API as a Http Request. What that is not clear is how the API connector actually work. When we still are in development phase and want to execute the API-Connector (and execute the user-flow via this), what type of http request we are supposed to send? Will it contain the Id/password we had defined when creating the API-Connector along with the user-details that needs to be passed to signup user-flow? What the URL which we had added when creating the API-Connector will be used for?
Unfortunately there is not much data available on API-Connector apart from the Azure official documentation, which I felt a bit confusing.

Obtaining an Azure Maps Access Token using a Azure Function

I'm trying to obtain a Azure Maps Token using a Azure Function based on the following documentation.
How to secure a single-page web application with non-interactive sign-in
Does anyone know how to create a Azure Maps Client using .NET similar to this?
AzureMapsManagement client library for JavaScript
They just released a .NET client library yesterday. You can find it here: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/maps
For example, if you wanted to use the search API, you would authenticate
in a similar manner to the JavaScript client library:
AzureKeyCredential credential = new AzureKeyCredential("<My Subscription Key>");
MapsSearchClient client = new MapsSearchClient(credential);
Here is some documentation on this client library: https://learn.microsoft.com/en-us/azure/azure-maps/how-to-dev-guide-csharp-sdk
For token base authentication you can use the Azure.Core.TokenCredential class. A good article on the different ways to do this can be found here: https://www.rahulpnath.com/blog/defaultazurecredential-from-azure-sdk/ (not putting code in stackoverflow as there are a lot of different ways depending on your scenario).

How to use Principal Propagation to call Workflow REST APIs

Is it possible to use Principal Propagation to call Workflow REST APIs using type-safe client? The way provided is via client credentials. Is there any plan to support principal propagation in the future?
https://sap.github.io/cloud-sdk/docs/java/features/rest/clients/scp-workflow-rest-api
Yes, it is possible to use the Principal Propagation Authentication flow to call the Workflow service while using the type-safe workflow client.
However, you cannot use the ScpCfServiceDestinationLoader to create the destination programmatically in this case. Currently, we only support client credentials flow with the loader.
Instead, you should create a destination in BTP(CF) with OAuth2UserTokenExchange authentication type and then subsequently use DestinationAccessor to fetch this destination.
We are evaluating options to extend the ScpCfServiceDestinationLoader API to support other authentication types but have not planned this feature yet.
Update: This has changed with Cloud SDK version 4.7.0. You can now use AuthenticationType.OAUTH2_USER_TOKEN_EXCHANGE with ScpCfServiceDestinationLoader.

Can I setup a web hook for a Method in Azure Api Management?

So, I have an API in Azure-API-Management, which is attached to a function. I want to expose one the method in API as Web-hook for another application CRM. It will be an inbound web-hook.
Is it possible ?
A webhook endpoint is like any other HTTP endpoint that usually expects a POST request from an external system. So, yes.
Depending on the CRM Application, you could leverage APIMs built-in security features to authenticate the webhook call without having to validate credentials in your function as a bonus for using APIM.

ANY connectors in logic apps that directly accepts soap request as Input

ANY connectors in logic apps that directly accepts soap request as Input.
IF any please let me know.
I searched for connectors but none is available in portal.
Currently, there are no built-in connectors to consume SOAP requests. But, you can create a Logic Apps custom connector to consume SOAP requests using WSDL that describes your SOAP service. Now, SOAP custom connectors don't support one-way operations.

Resources