Written by

Question Mike Todd · Oct 21, 2016

how configure Ensemble web service to use HTTP Basic authenication

Hello, trying to figure out how to configure an Ensemble web service to use HTTP Basic authentication.  I have a web service client that will not be able to send SOAP headers.  I did not see that option at all in the documentation.  thanks

Comments

Steve Pisani · Oct 27, 2016

Hi Mike. 

Have you already tried setting up  a Credentials record (with username and password paid via Ensemble > Configure > Credentials), and then specifying the credentials record which will be a setting in the Ensemble business operation ?

This has worked form me before with Web services that require basic authentication.

Regards

Steve

0
Steve Pisani · Oct 27, 2016

Hi Mike. 

Have you already tried setting up  a Credentials record (with username and password paid via Ensemble > Configure > Credentials), and then specifying the credentials record which will be a setting in the Ensemble business operation ?

This has worked form me before with Web services that require basic authentication.

Regards

Steve

0
Steve Pisani · Oct 27, 2016

Hi Mike

Have you tried setting up a Credentials  record with username and password pair in Ensemble  (Configure>Credentials) - then specifying the credentials name in Settings for the Ensemble u business operation ?

This has worked for me before for Web services that require basic authentication.

Steve

0
Mike Todd  Nov 2, 2016 to Steve Pisani

Thanks Steve.  in this case Ensemble is hosting the web service, and my client is a JCAPS app.  But I did figure out how to have JCAPS send the SOAP hdr.

0
Rob van Olst · Nov 1, 2016

Here's what I do:

authorization64 = $G(pInput.Attributes("authorization"))
// ? valid
if ($PIECE(authorization64," ",1) '= "Basic"){
Status = ##class(%SYSTEM.Status).Error(5001, "Missing basic http authentication")
Throw ##class(%Exception.StatusException).CreateFromStatus(Status)
}
//  basic http authentication looks like this: "Basic amFhcDphYXA="
authorization = $System.Encryption.Base64Decode($PIECE(authorization64," ",2))
// decoded it looks like this: "username:password"
username = $PIECE(authorization,":",1)
password = $PIECE(authorization,":",2)
 

0
Mike Todd  Nov 2, 2016 to Rob van Olst

Thanks!  I'll try it out.

0