setup twitter
This commit is contained in:
parent
627a1de48f
commit
2f97f77824
|
@ -4,11 +4,17 @@
|
|||
{% if error is defined and error %}
|
||||
<span>{{ error }}</span>
|
||||
{% endif %}
|
||||
{% for owner in hwi_oauth_resource_owners() %}
|
||||
<a class="btn btn-default btn-block btn-{{ owner }}" href="{{ hwi_oauth_login_url(owner) }}">
|
||||
<i class="fa fa-{{ owner }}"></i>
|
||||
{{ owner | trans({}, 'HWIOAuthBundle') }}
|
||||
</a>
|
||||
<br/>
|
||||
{% endfor %}
|
||||
|
||||
<a class="btn btn-default btn-block btn-{{ "twitter" }}" href="{{ hwi_oauth_login_url("twitter") }}">
|
||||
<i class="fa fa-{{ "twitter" }}"></i>
|
||||
{{ "twitter" | trans({}, 'HWIOAuthBundle') }}
|
||||
</a>
|
||||
|
||||
{#{% for owner in hwi_oauth_resource_owners() %}#}
|
||||
{#<a class="btn btn-default btn-block btn-{{ owner }}" href="{{ hwi_oauth_login_url(owner) }}">#}
|
||||
{#<i class="fa fa-{{ owner }}"></i>#}
|
||||
{#{{ owner | trans({}, 'HWIOAuthBundle') }}#}
|
||||
{#</a>#}
|
||||
{#<br/>#}
|
||||
{#{% endfor %}#}
|
||||
{% endblock hwi_oauth_content %}
|
||||
|
|
|
@ -86,6 +86,12 @@ fos_user:
|
|||
hwi_oauth:
|
||||
# list of names of the firewalls in which this bundle is active, this setting MUST be set
|
||||
firewall_names: [secured_area]
|
||||
fosub:
|
||||
username_iterations: 30
|
||||
properties:
|
||||
google: google_id
|
||||
twitter: twitter_id
|
||||
disqus: disqus_id
|
||||
# an optional setting to configure a query string parameter which can be used to redirect
|
||||
# the user after authentication, e.g. /connect/facebook?_destination=/my/destination will
|
||||
# redirect the user to /my/destination after facebook authenticates them. If this is not
|
||||
|
|
|
@ -23,7 +23,7 @@ security:
|
|||
failure_path: /login
|
||||
|
||||
oauth_user_provider:
|
||||
service: my.oauth_aware.user_provider.service
|
||||
service: my.custom.user_provider
|
||||
# disables authentication for assets and the profiler, adapt it according to your needs
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
|
|
|
@ -38,8 +38,8 @@ services:
|
|||
class: HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider
|
||||
arguments:
|
||||
- '@fos_user.user_manager'
|
||||
- ['@fos_user.user_manager', { google: googleId , twitter: twitterId, disqus: disqusId}]
|
||||
- ['@fos_user.user_manager', twitter: twitter_id]
|
||||
|
||||
my.custom.user_provider:
|
||||
class: MyBundle\Security\Core\User\MyFOSUBUserProvider
|
||||
arguments: ['@fos_user.user_manager', { facebook: facebook_id ,twitter: twitterId, disqus: disqusId }]
|
||||
class: AppBundle\Security\Core\User\MyFOSUBUserProvider
|
||||
arguments: ['@fos_user.user_manager', {twitter: twitter_id}]
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace AppBundle\Security\Core\User;
|
||||
|
||||
use AppBundle\Entity\User;
|
||||
use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface;
|
||||
use HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider as BaseFOSUBProvider;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
|
Loading…
Reference in New Issue