Skip to content

Commit

Permalink
Backport changes from 0.4 version
Browse files Browse the repository at this point in the history
  • Loading branch information
stloyd committed Nov 15, 2014
1 parent 25b60de commit a614cb1
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 33 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
Changelog
=========

## 0.3.7 (2014-06-xx)
## 0.3.7 (2014-11-15)
* Fix: `SessionStorage::save()` could throw php error,
* Fix: `OAuthToken::isExpired()` always returned `false`
* Fix: `OAuthToken::isExpired()` always returned `false`,
* Fix: `FoursquareResourceOwner`, `TwitchResourceOwner`, `SensioConnectResourceOwner`
not working with bearer header,
* Fix: Don't use deprecated fields in `FacebookResourceOwner`,
* Fix: `FOSUBUserProvider::refreshUser()` always returning old user,

## 0.3.6 (2014-06-02)
* Fix: `InstagramResourceOwner` regression while getting user details,
Expand Down
2 changes: 1 addition & 1 deletion OAuth/ResourceOwner/FacebookResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class FacebookResourceOwner extends GenericOAuth2ResourceOwner
*/
protected $paths = array(
'identifier' => 'id',
'nickname' => 'username',
'nickname' => 'name',
'realname' => 'name',
'email' => 'email',
);
Expand Down
10 changes: 6 additions & 4 deletions OAuth/ResourceOwner/FoursquareResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ protected function configureOptions(OptionsResolverInterface $resolver)
parent::configureOptions($resolver);

$resolver->setDefaults(array(
'authorization_url' => 'https://foursquare.com/oauth2/authorize',
'access_token_url' => 'https://foursquare.com/oauth2/access_token',
'infos_url' => 'https://api.foursquare.com/v2/users/self',
'authorization_url' => 'https://foursquare.com/oauth2/authenticate',
'access_token_url' => 'https://foursquare.com/oauth2/access_token',
'infos_url' => 'https://api.foursquare.com/v2/users/self',

// @link https://developer.foursquare.com/overview/versioning
'version' => '20121206',
'version' => '20121206',

'use_bearer_authorization' => false,
));
}
}
12 changes: 7 additions & 5 deletions OAuth/ResourceOwner/SensioConnectResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ protected function configureOptions(OptionsResolverInterface $resolver)
parent::configureOptions($resolver);

$resolver->setDefaults(array(
'authorization_url' => 'https://connect.sensiolabs.com/oauth/authorize',
'access_token_url' => 'https://connect.sensiolabs.com/oauth/access_token',
'infos_url' => 'https://connect.sensiolabs.com/api',
'authorization_url' => 'https://connect.sensiolabs.com/oauth/authorize',
'access_token_url' => 'https://connect.sensiolabs.com/oauth/access_token',
'infos_url' => 'https://connect.sensiolabs.com/api',

'user_response_class' => '\HWI\Bundle\OAuthBundle\OAuth\Response\SensioConnectUserResponse',
'user_response_class' => '\HWI\Bundle\OAuthBundle\OAuth\Response\SensioConnectUserResponse',

'response_type' => 'code',
'response_type' => 'code',

'use_bearer_authorization' => false,
));
}
}
7 changes: 4 additions & 3 deletions OAuth/ResourceOwner/TwitchResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ protected function configureOptions(OptionsResolverInterface $resolver)
parent::configureOptions($resolver);

$resolver->setDefaults(array(
'authorization_url' => 'https://api.twitch.tv/kraken/oauth2/authorize',
'access_token_url' => 'https://api.twitch.tv/kraken/oauth2/token',
'infos_url' => 'https://api.twitch.tv/kraken/user',
'authorization_url' => 'https://api.twitch.tv/kraken/oauth2/authorize',
'access_token_url' => 'https://api.twitch.tv/kraken/oauth2/token',
'infos_url' => 'https://api.twitch.tv/kraken/user',
'use_bearer_authorization' => false,
));
}
}
7 changes: 4 additions & 3 deletions OAuth/ResourceOwner/TwitterResourceOwner.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ class TwitterResourceOwner extends GenericOAuth1ResourceOwner
* {@inheritDoc}
*/
protected $paths = array(
'identifier' => 'id_str',
'nickname' => 'screen_name',
'realname' => 'name',
'identifier' => 'id_str',
'nickname' => 'screen_name',
'realname' => 'name',
'profilepicture' => 'profile_image_url_https',
);

/**
Expand Down
2 changes: 1 addition & 1 deletion Resources/doc/internals/response_object_and_paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ hwi_oauth:
client_id: <client_id>
client_secret: <client_secret>
scope: "email"
infos_url: "https://graph.facebook.com/me?fields=username,name,email,picture.type(square)"
infos_url: "https://graph.facebook.com/me?fields=id,name,email,picture.type(square)"
paths:
email: email
profilepicture: picture.data.url
Expand Down
4 changes: 2 additions & 2 deletions Resources/doc/resource_owners/amazon.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ hwi_oauth:
When you're done. Continue by configuring the security layer or go back to
setup more resource owners.
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](3-configuring_the_security_layer.md).
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](../2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](../3-configuring_the_security_layer.md).
4 changes: 2 additions & 2 deletions Resources/doc/resource_owners/eventbrite.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ hwi_oauth:
When you're done. Continue by configuring the security layer or go back to
setup more resource owners.
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](3-configuring_the_security_layer.md).
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](../2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](../3-configuring_the_security_layer.md).
4 changes: 2 additions & 2 deletions Resources/doc/resource_owners/salesforce.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ hwi_oauth:
When you're done. Continue by configuring the security layer or go back to
setup more resource owners.
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](3-configuring_the_security_layer.md).
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](../2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](../3-configuring_the_security_layer.md).
6 changes: 3 additions & 3 deletions Resources/doc/resource_owners/trello.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Step 2x: Setup Trello
First you will have to register your application on Trello. Check out the
documentation for more information: https://trello.com/docs/gettingstarted/authorize.html.

Next configure a resource owner of type `amazon` with appropriate
Next configure a resource owner of type `trello` with appropriate
`client_id`, `client_secret` and `scope`.

```yaml
Expand All @@ -20,5 +20,5 @@ hwi_oauth:
When you're done. Continue by configuring the security layer or go back to
setup more resource owners.
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](3-configuring_the_security_layer.md).
- [Step 2: Configuring resource owners (Facebook, GitHub, Google, Windows Live and others](../2-configuring_resource_owners.md)
- [Step 3: Configuring the security layer](../3-configuring_the_security_layer.md).
4 changes: 2 additions & 2 deletions Resources/doc/resource_owners/vkontakte.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Step 2x: Setup Vkontakte
========================
First you will have to register your application on Vkontakte. Check out the
documentation for more information: http://vk.com/developers.php.
documentation for more information: https://vk.com/dev.

Next configure a resource owner of type `vkontakte` with appropriate
`client_id`, `client_secret` and `scope`. Refer to the Vkontakte documentation
for the available [scopes](http://vk.com/developers.php?oid=-17680044&p=Application_Access_Rights).
for the available [scopes](https://vk.com/dev/permissions).

```yaml
# app/config/config.yml
Expand Down
2 changes: 1 addition & 1 deletion Resources/translations/HWIOAuthBundle.fr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
header:
connecting: Connexion en cours
success: Connexion réussie avec le compte '%name%' !
register: S'incrire avec le compte '%name%'
register: S'inscrire avec le compte '%name%'
registration_success: Enregistrement et connexion du compte '%username%' réussis !

connect:
Expand Down
2 changes: 1 addition & 1 deletion Security/Core/User/FOSUBUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function refreshUser(UserInterface $user)
throw new UsernameNotFoundException(sprintf('User with ID "%d" could not be reloaded.', $userId));
}

return $user;
return $reloadedUser;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class GenericOAuth2ResourceOwnerTest extends \PHPUnit_Framework_TestCase

protected $userResponse = <<<json
{
"id": "1"
"id": "1",
"foo": "bar"
}
json;
Expand Down

0 comments on commit a614cb1

Please sign in to comment.