Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic HTTP Auth? #97

Open
RedactedProfile opened this issue Nov 25, 2014 · 3 comments
Open

Basic HTTP Auth? #97

RedactedProfile opened this issue Nov 25, 2014 · 3 comments

Comments

@RedactedProfile
Copy link

Having a situation where authentication is to be handled not through a proxy, but through basic HTTP Auth

I am adapting an existing Soap interface to BeSimple's, it used to look like this:

       // authentication
        $options['login'] = $this->username;
        $options['password'] = $this->password;
       // build client
        $client = new SoapClient(API_URL, $options);

where SoapClient is PHP's built in SoapClient class (which I see BeSimple's extends from)

However, no where do I see an option to provide these two configuration options, UNLESS I attempt to use the proxy settings, which do not work correctly no matter how I configure it. When I don't configure auth of any kind, I get SoapClient::__doRequest() returned non string value but when I provide the proxy options, it takes a million years to come back with ErrorException: SOAP-ERROR: Parsing WSDL: Couldn't load from {my private api url}

How do I provide these two options?

@matheo
Copy link

matheo commented Dec 5, 2014

This comment may help you:
http://php.net/manual/es/class.soapclient.php#102503

@uelnur
Copy link

uelnur commented Oct 6, 2016

The BeSimple's ClientBuilder has withBasicAuthentication method, which takes loginand password as parameters.
It can be used like this:

$builder = $this->get('besimple.soap.client.builder.client_name');
$builder->withBasicAuthentication('login', 'password');
$client = $builder->build();

It would be good to add the posibility to config basic authentication in config.yml, like this:

be_simple_soap:
  clients:
    client_name:
      ...
      auth:
        login: %soap_login%
        password: %soap_password%
      ...

and add the appropriate code to the BeSimpleSoapExtension to process those config

@RedactedProfile
Copy link
Author

Hi uelnur

I had eventually tried to use that option but it still did not function
quite right

This issue is two years old, I've not only since opted to just use phps
SoapClient class, but we've since replaced the soap api with a restful json
one lol

Thanks anyways!

On Oct 6, 2016 6:31 AM, "uelnur" [email protected] wrote:

The BeSimple's ClientBuilder has withBasicAuthentication method, which
takes loginand password as parameters.
It can be used like this:

$builder = $this->get('besimple.soap.client.builder.client_name');$builder->withBasicAuthentication('login', 'password');$client = $builder->build();

It would be good to add the posibility to config basic authentication in
config.yml, like this:

be_simple_soap:
clients:
client_name: ...
auth:
login: %soap_login%
password: %soap_password% ...

and add the appropriate code to the BeSimpleSoapExtension to process
those config


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#97 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA_eJ2HZFGbwrZgiXxQaEBSt4quW-UQMks5qxPhHgaJpZM4DApPB
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants