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

Support for sign-in & sign-up via OAuth resource owner #354

Merged
merged 6 commits into from
Oct 30, 2013

Conversation

stloyd
Copy link
Contributor

@stloyd stloyd commented Sep 26, 2013

Rebased version of #163.

@@ -5,17 +5,17 @@
<h1>Login <small>Sylius store</small></h1>
</div>

{% if error %}
<div class="alert alert-error">
{{ error }}
Copy link
Contributor

Choose a reason for hiding this comment

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

This message should be translated, right?

@winzou
Copy link
Contributor

winzou commented Sep 26, 2013

@headrevision @stloyd is there a reason for not having added Facebook in this PR? (different mechanism?)

@headrevision
Copy link
Contributor

@winzou No, there is no difference. I simply was not interested in adding Facebook.

@winzou
Copy link
Contributor

winzou commented Oct 4, 2013

OK, this is great. If you or @stloyd want to add it, it would be even greater :p

There is an error on the build: https://travis-ci.org/stloyd/Sylius/jobs/11815773#L735 Composer is weirdly not installing OAuthBundle.

@pjedrzejewski
Copy link
Member

@stloyd I think it would be super-awesome to have Google, Facebook, Amazon initially, possible? :P (with my help)

@pjedrzejewski
Copy link
Member

@stloyd Can we help you with this somehow? :)

@stloyd
Copy link
Contributor Author

stloyd commented Oct 11, 2013

@pjedrzejewski I guess that's is good, maybe just some behat test would require some polishing/extending, but I don't have time for this right now.

@headrevision
Copy link
Contributor

@stloyd Let's face it: The Behat scenarios for the OAuth sign-in/-up won't never run successfully. First they come with an extraordinary complexity (third-party websites, switching back and forth to Sylius, SSL, Javascript, etc.). Second (and much worse) they are critical to security (resource owner setup, actual user account for each resource owner).

The latter makes it virtually impossible to have a completely pre-configured reference implementation for testing. Even Travis CI's secure environment variables are not a solution. The credentials would remain insecure in respect of account hijacking and Google, Facebook, Amazon, etc. don't offer user accounts (+ terms of use) just for testing. The only solution is to use your own OAuth server such that you could at least test a reference implementation for that "dummy" resource owner.

@pjedrzejewski
Copy link
Member

Yeah, that was my concern too... thanks for clarifying that @headrevision, I never worked with OAuth through Behat. What's our best option here? I think removing these scenarios is acceptable.

@headrevision
Copy link
Contributor

@pjedrzejewski see stloyd#2

headrevision and others added 5 commits October 30, 2013 10:24
…ign-in provider account (incomplete)

added step to initially grant access for app in OAuth login scenarios
disabled cache clearing
removed obsolete code
restored cache clearing
added given step to OAuth login scenarios
set placeholder values for resource owner client id + secret
execute scenarios with saucelabs on travic ci apache
added phpspec for oauth user provider
used local selenium server for travis ci instead of sauce labs
Add missing facebook logo, rework some html stuff with new design
… successfully with pre-configured resource owner
@@ -0,0 +1,5 @@
{% for owner in hwi_oauth_resource_owners() %}
<a class="oauth-login oauth-login-{{ owner|trans({}, 'HWIOAuthBundle') }}" href="{{ hwi_oauth_login_url(owner) }}" title="{{ owner|trans({}, 'HWIOAuthBundle') }}">
<img src="/assets/img/icon/64/{{ owner|trans({}, 'HWIOAuthBundle') }}.png" alt="{{ owner|trans({}, 'HWIOAuthBundle') }}">
Copy link
Member

Choose a reason for hiding this comment

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

This img should be in WebBundle/assets I think.

pjedrzejewski pushed a commit that referenced this pull request Oct 30, 2013
Support for sign-in & sign-up via OAuth resource owner
@pjedrzejewski pjedrzejewski merged commit 3dfe0d7 into Sylius:master Oct 30, 2013
@pjedrzejewski
Copy link
Member

Good step forward, thanks both Józef and Fabian!

@stloyd stloyd deleted the feature/hwi_oauth branch October 30, 2013 11:30
@immutef
Copy link

immutef commented Oct 30, 2013

Cool, I always wondered how others integrated this bundle. Seems I wasn't too wrong :D


// set default values taken from OAuth sign-in provider account
if (null !== $email = $response->getEmail()) {
$user->setEmail($email);

Choose a reason for hiding this comment

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

isn't this insecure? after OAuth authentication my email could be anyone

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess, yes & no =)

Yes - because in theory it's possible,
No - because most of oauth providers have built-in email verification systems, so you can't have email you want, but only that one you can confirm.

@inmarelibero Can you open new issue, so we could disscuss more clearly? Thanks!

Choose a reason for hiding this comment

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

sure

Choose a reason for hiding this comment

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

done, #695

pamil pushed a commit to pamil/Sylius that referenced this pull request Mar 21, 2016
[Locale] Documentation of Locale component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants