[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Posting Requests To Microsoft Azure



Hi

I have a new requirement to post requests to a REST web service hosted on a Microsoft Azure platform. I've had success in the past using Scott's HTTPAPI service program to post XML requests to a SOAP service, and I believe that posting to REST should be no problem either.

I have two stumbling blocks that I know of, though, and they are shown on a page that explains how to make requests to the new service - https://msdn.microsoft.com/en-us/library/azure/mt428036.aspx. I'll list them here:

1) "To make a data request to the Data Catalog REST service, you need to supply an access token. In a .NET client app, you use the Windows Azure Authentication Library (ADAL) to get an access token."

string authorityUri = "https://login.windows.net/common/oauth2/authorize";;
AuthenticationContext authContext = new AuthenticationContext(authorityUri); AuthenticationResult token = authContext.AcquireToken(resourceUri, clientId, new Uri(redirectUri), PromptBehavior.RefreshSession);

2) "After you get an access token from Active Directory (AAD), you use the token to make a web request to the Data Catalog REST API. To create a Data Catalog REST web request, you add an access token to a request header."


I have no idea how to tackle step 1 - get an access token. The example is .NET, and I suspect I can't do this. Step 2 - add the token to a request header might be possible, as I've seen examples that use http_setauth to pass a user id and password. Can I use http_setauth to send an access token?

I've already prepared my boss for disappointment on this, but I need to know: is there a way to do step 1 in RPG?

Thanks for any input.

Paul


Enterprise Software Systems.
Company No 3374336. Registered in England,
Registered Office: Enterprise House, Pacific Road
Altrincham, Cheshire, WA14 5EN

The information in this email is confidential and may be legally
privileged. It is intended solely for the addressee. Access to this email
by anyone else is unauthorized. If you are not the intended recipient, any
disclosure, copying, distribution or any action taken or omitted to be
taken in reliance on it, is prohibited and may be unlawful. If you are not
the intended addressee please contact the sender and dispose of this
e-mail.


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------