Author |
Message
|
harristm |
Posted: Sun Feb 02, 2014 9:36 pm Post subject: Basic Authentication worked but now it doesn't |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
I am using IIB V9.0.0.1 on RedHat Enterprise Linux 6.4 with a bash shell.
I have been using the following for HTTP Basic Authentication to a web service
Code: |
SET OutputRoot.Properties.IdentitySourceType='usernameAndPassword';
SET Output Root.Properties.IdentitySourceToken = 'my_id' ;
SET OutputRoot.Properties.IdentitySourcePassword ='my_pw' ;
|
I build an Application from the New->Quickstart menu->Start from WSDL or XSD
I drop the copy of the WSDL from inside the application onto a flow
add a File Input node, a compute node for setting the authentication and trace nodes for the outputs.
I create a bar, point to the application that I just built , build the bar, check that the security profile is set to 'Default Propagation', save the bar and deploy it
I drop a file into the incoming directory for the File Input node with the request to be sent to the web service. The File Input node picks up the file, parses it with the XMLNSC parser and passes it to the compute node which puts on the id and password. The message then passes it to the generated SOAP Request node and generated subflow.
The web service receives the request and provides a response,
this all works great.
I enabled ODBC by putting the following in a file named fixodbc.sh in /var/mqsi/common/profiles/
Code: |
ODBCINI=/var/mqsi/odbc/odbc.ini
export ODBCINI
|
I can seee the ODBCINI setting if I do the following:
I reboot everything and the flow that I built before ODBCINI was set still runs the way I want it to. If I build the flow after setting ODBCINI then the flow gets a HTTP 401 Not Authorized response from the web service. I did confirm that the Security Profile was still set to Default Propagation.
The only thing that changed was re-building the bar with ODBCINI set.
The compute node I use to set the authentication tokens doesn't have any database calls in it. But I do need to be able to query a database and call the web service with results from the database.
If I take out the ODBCINI setting shell script, stop and restart the broker, then re-build the flow, it works again.
Does anybody have any ideas what I might have wrong?
I set up ODBC and can connect to a database, get data.
I need to call the web service with the results of the db call so I need to have the ODBCINI set, and I would rather not have to turn off ODBCINI every time I want to build.
Thank you for your time and any thoughts on where I go from here
Sincerely
Tracy |
|
Back to top |
|
 |
dogorsy |
Posted: Mon Feb 03, 2014 1:50 am Post subject: Re: Basic Authentication worked but now it doesn't |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
harristm wrote: |
If I build the flow after setting ODBCINI then the flow gets a HTTP 401 Not Authorized response from the web service. |
The building of the bar file and the ODBCINI are completely separate things and have no influence in each other whatsoever.
Quote: |
If I take out the ODBCINI setting shell script, stop and restart the broker, then re-build the flow, it works again.
|
You probably need to look at the shell script and see what else it is doing. Maybe setting a userid/password ?.
The odbc is for controlling access to the databases, but you are getting an HTTP 401, which means the user is not authorized to access that service. Again, nothing to do with the database. |
|
Back to top |
|
 |
harristm |
Posted: Mon Feb 03, 2014 8:10 am Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
The shell script is completely what I pasted with the script header line.
I agree with you that these two things should not affect each other but these are the steps I went through. I build with ODBCINI set and the flow doesn't send authentication. I build without ODBCINI set and the flow does send authentication.
Sincerely
Tracy |
|
Back to top |
|
 |
dogorsy |
Posted: Mon Feb 03, 2014 8:16 am Post subject: |
|
|
Knight
Joined: 13 Mar 2013 Posts: 553 Location: Home Office
|
harristm wrote: |
The shell script is completely what I pasted with the script header line. |
Sorry, I do not understand the above.
Quote: |
I agree with you that these two things should not affect each other but these are the steps I went through. I build with ODBCINI set and the flow doesn't send authentication. I build without ODBCINI set and the flow does send authentication.
|
What do you mean by build ? build the bar file ? If so, setting the ODBCINI does not mean you have to rebuild it. And, why do you say the flow does not send authentication? have you traced the call ? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 03, 2014 8:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
it's not really clear what you mean by "building the BAR with ODBCINI set".
Are you using Toolkit to build the bar? or mqsicreatebar? or mqsipackagebar?
Regardless, you are probably causing the security profile to NOT be set on the bar file when you deploy it. You should be looking at using mqsiapplybaroverride to ensure it's set. |
|
Back to top |
|
 |
harristm |
Posted: Mon Feb 03, 2014 9:02 am Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
mqjeff:
Thanks for the reply.
I build the bar using the Toolkit.
I get a different behavior out of the bar depending on the ODBCINI environment variable being set or not.
I check the security profile on the SOAP Request node to make sure it is Default Propagation before deploying the bar. If it isn't set to Default Propagation, I set it to that and save the bar, then deploy.
If I build the bar in the Toolkit with ODBCINI set, the basic authentication set in the compute node does not get included on the web service request.
Is it possible I have something else set or un-set ?
I run mqsicvp and when ODBCINI is set it is happy with the ODBC setup
and comments that ODBCINI isn't set when it isn't
Dogorsy:
Thank you also. I build the bar in the Toolkit, I was setting up ODBC so I could get to a database as part of the flow and the web service call stopped working. I went with the question "what did I change last" which was ODBCINI. I un-changed it and the web service call worked if I re-built the bar with ODBCINI off. I can trace it with Wireshark and have seen the credentials sent in the HTTP request, I looked for them with the flow built with ODBCINI set and I didn't see them. I admit, I don't have an exact 'the credentials are supposed to be here' map but scanning through the HTTP trace I did not see the id or pw.
I presume that ODBC and Web Services play nicely in IIB I just need to figure out what I did to make it take this funny turn.
I would like to be able to not have to put the id and pw on using the comppute node. That would be a code change in production when we change passwords.
I use mqsisetdbparms for my database connections and it makes it manageable. I haven't seen where or how I can set something similar for SOAP Requests. Is it as simple as setting a profile with mqsisetdbparms? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Feb 03, 2014 10:20 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You shouldn't need ODBCINI set in the Toolkit... not really sure why you are.
Again, I'd be tempted to verify the properties of the BAR file are actually correct after you have saved it, by using mqsireadbar. |
|
Back to top |
|
 |
harristm |
Posted: Mon Feb 03, 2014 5:42 pm Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
mqjeff:
I will go back through and review everything. thank you for the gentle suggestion. |
|
Back to top |
|
 |
harristm |
Posted: Tue Feb 04, 2014 2:48 pm Post subject: |
|
|
Apprentice
Joined: 02 Aug 2012 Posts: 29
|
My sincere apologies. You were all right.
I can build a bar using the IIB Toolkit, with ODBCINI set, check the Security Profile to Default Propagation and it sends the basic authentication information along the flow.
Thank you all for your time and patience.
I do have two other questions but I will take them up in separate posts to not confuse things.
Thank you for all of your help.
Sincerely
Tracy |
|
Back to top |
|
 |
|