Author |
Message
|
vanshulchawla_target |
Posted: Tue May 25, 2010 11:58 pm Post subject: Basic HTTP Authentication |
|
|
Apprentice
Joined: 19 May 2010 Posts: 25
|
I have a requirement.I need to access a service using HTTPRequest node.I need to set the username and password because the external webservice needs to authenticate our request.
I need to set the username and password in basci HTTP authentication mechanisn.
Please help me as to how to use the same in message broker?
Can i code it in esql? |
|
Back to top |
|
 |
n1ghtrain |
Posted: Wed May 26, 2010 10:04 pm Post subject: s |
|
|
 Apprentice
Joined: 23 Mar 2006 Posts: 48 Location: Bangalore
|
|
Back to top |
|
 |
vanshulchawla_target |
Posted: Wed May 26, 2010 10:28 pm Post subject: |
|
|
Apprentice
Joined: 19 May 2010 Posts: 25
|
Hi,
Thanks but its only applicable when we use security profiles i think |
|
Back to top |
|
 |
n1ghtrain |
Posted: Thu May 27, 2010 2:36 am Post subject: |
|
|
 Apprentice
Joined: 23 Mar 2006 Posts: 48 Location: Bangalore
|
I don't think u need to use the security profiles unless you need it for connect to LDAP or so to validate the identity. I
f you just need to send a HTTP request with Basic Authentication this should be good enough. |
|
Back to top |
|
 |
napier |
Posted: Fri May 28, 2010 11:44 am Post subject: |
|
|
 Apprentice
Joined: 09 Oct 2007 Posts: 48 Location: USA
|
You can do it using compute node before the HTTP request node.
Add the following state ment in compute node
SET OutputRoot.HTTPRequestHeader."Authorization" = 'Basic '||base64Encode(CAST('username:password' as BLOB CCSID InputRoot.Properties.CodedCharSetId));
CREATE PROCEDURE base64Encode(IN source BLOB)
RETURNS CHARACTER
LANGUAGE JAVA
EXTERNAL NAME "com.ibm.broker.javacompute.Base64.encode"; |
|
Back to top |
|
 |
AndreasMartens |
Posted: Fri Jun 04, 2010 2:39 am Post subject: Properties and Security Profiles for the win! |
|
|
 Acolyte
Joined: 30 Jan 2006 Posts: 65 Location: Hursley, UK
|
Do you have any reason not to use a security profile on the request node?
Setting Properties.Identity[Source|Mapped][Type|Token|Password|IssuedBy] is an easy way of telling the broker which Identity you want to use with this message, without needing to deal with having to encode and place it in the right header yourself. Then you just set the securityProfile of the request node to "Default_Propagation" and it'll massage the headers for you. It won't so any more than that on the request node (the request node only uses the Propagation field of the profile) so you don't need to worry about LDAP etc.
cheers,
Andreas |
|
Back to top |
|
 |
mq4u |
Posted: Tue Nov 20, 2012 5:49 pm Post subject: |
|
|
Newbie
Joined: 20 Nov 2012 Posts: 2
|
Quote: |
SET OutputRoot.Properties.IdentityMappedType = 'usernameAndPassword';
SET OutputRoot.Properties.IdentityMappedToken = 'xxx';
SET OutputRoot.Properties.IdentityMappedPassword = 'yy';
SET OutputRoot.Properties.IdentityMappedIssuedBy = 'zz';
|
Can we use these Properties field in Broker 6.1.0.10 ?
Quote: |
Do you have any reason not to use a security profile on the request node? |
But still one has to hardcode the username/password in compute node. I guess basic authentication without LDAP will not work without hardcoding credentials in the message flow. So, my second question is can we use a combination of configurable services and security profiles to avoid hardcoding the username/password in message flow and instead the administrator sets up username/password.
Sorry, this reply is on a little old thread.
Thanks. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Nov 20, 2012 6:18 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mq4u wrote: |
Quote: |
SET OutputRoot.Properties.IdentityMappedType = 'usernameAndPassword';
SET OutputRoot.Properties.IdentityMappedToken = 'xxx';
SET OutputRoot.Properties.IdentityMappedPassword = 'yy';
SET OutputRoot.Properties.IdentityMappedIssuedBy = 'zz';
|
Can we use these Properties field in Broker 6.1.0.10 ? |
Are they in the v6.1.0.10 documentation.
Quote: |
Do you have any reason not to use a security profile on the request node? |
mq4u wrote: |
But still one has to hardcode the username/password in compute node. |
No you don't. You just need to supply it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|