[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Posting Requests To Microsoft Azure
Hi Rainer
Thanks for the pointer about Oauth. I'll do a bit of reading on that
when I next get some "spare" time!
Thanks,
Paul
On 31/03/2016 23:49, Rainer Ross wrote:
Hi Paul,
last year I realized a connection to a webservice with RPG and Oauth
1.0 authentification.
This was hard stuff.
On [1]http://www.itjungle.com/tfh/tfh031815-story04.html is a story
about Oauth 2.0 on IBM i.
For testing a Oauth 2.0 connection you can use the RESTClient for
Firefox or Postman for Chrome.
best regards
Rainer
Am 31.03.2016 um 14:21 schrieb Paul Park:
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 -
[2]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 =
[3]"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:
[4]http://www.scottklement.com/mailman/listinfo/ftpapi
--------------------------------------------------------------------
---
--------------------------------------------------------------------
---
This is the FTPAPI mailing list. To unsubscribe, please go to:
[5]http://www.scottklement.com/mailman/listinfo/ftpapi
--------------------------------------------------------------------
---
--
Paul Park
Application Developer
enterprise SOFTWARE
Registered Office: Enterprise House | Pacific Road | Atlantic Office
Park | Altrincham | Cheshire | WA14 5EN
Office: 0161 925 2400 | email: [6]parkp@xxxxxxxxxx | Web:
[7]www.essl.co.uk
__________________________________________________________________
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 ema
il
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.
References
Visible links
1. http://www.itjungle.com/tfh/tfh031815-story04.html
2. https://msdn.microsoft.com/en-us/library/azure/mt428036.aspx
3. https://login.windows.net/common/oauth2/authorize
4. http://www.scottklement.com/mailman/listinfo/ftpapi
5. http://www.scottklement.com/mailman/listinfo/ftpapi
6. mailto:parkp@xxxxxxxxxx
7. http://www.essl.co.uk/
Hidden links:
8. mailto:parkp@xxxxxxxxxx
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------