Skip to content

Add auto BasicAuth credential detection based on URL #38

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

Merged
merged 1 commit into from
Mar 29, 2016

Conversation

sagikazarmark
Copy link
Member

No description provided.

@xabbuh
Copy link
Member

xabbuh commented Mar 7, 2016

Could this work with Digest authentication too?

@sagikazarmark
Copy link
Member Author

Good question.

I think as in case of oauth, digest auth can only work as a separate plugin as it needs a request first in order to retrieve the server nonce.

So with a slightly difference code and a different plugin: probably yes.

But as a plain authentication method: not sure. Since the method is immutable, you have to provide every data in the constructor.


namespace spec\Http\Message\Authentication;

trait AuthenticationBehavior
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did this not work as expected?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did (partly). However PHPSpec currently does not support more complex examples (eg. it cannot use prophecy as function arguments) because of some sort of autoloading issues. So I decided to remove this because I though it didn't make sense just to avoid duplication of one example.

Copy link
Contributor

@dbu dbu Mar 29, 2016 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dbu
Copy link
Contributor

dbu commented Mar 29, 2016

is this what a web browser does with such urls? then i agree this is a good thing to have. is there a corresponding doc PR already? if not, at least create an issue - if we lose track of features the doc will quickly go out of sync and it becomes a huge pain to figure out discrepancies (been there, done that)

@sagikazarmark
Copy link
Member Author

Yes, this is a client responsibility. Will open a doc PR. It will probably be easier if we start using issue/PR templates: https://github.com/php-http/boilerplate/tree/master/.github

@sagikazarmark sagikazarmark merged commit fad9552 into master Mar 29, 2016
@sagikazarmark sagikazarmark deleted the auto_basic_auth branch March 29, 2016 20:21
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

Successfully merging this pull request may close these issues.

3 participants