Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit c451860

Browse files
committed
Merge pull request #112 from stormpath/hotfix/Release_1.12.1
Hotfix/release 1.12.1
2 parents 4dc14d6 + f662eff commit c451860

26 files changed

+152
-76
lines changed

CHANGES.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
stormpath-sdk-php Changelog
22
===========================
33

4+
Version 1.12.1
5+
--------------
6+
7+
Released on December 15, 2015
8+
9+
- Social Providers isNewAccount was always returning null. This has been fixed (Fixes Issue #109)
10+
- Handle ID Site would throw new exception if account was not valid, This prevented you from accessing state or any other properties
11+
You can not access all properties, and account will just remain null. (Fixes Issue #110)
12+
- Documentation issue on API Keys and Account for Request Authenticators. (Fixes Issue #105)
13+
- Update the Base Test so it is not treated as a test.
14+
415
Version 1.12.0
5-
------------------
16+
--------------
617

718
Released on November 5, 2015
819

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,10 +1834,10 @@ The `Authorization` header contains a base64 encoding of the API Key and Secret.
18341834
$application = \Stormpath\Resource\Application::get("https://api.stormpath.com/v1/applications/24mp4us71ntza6lBwlu");
18351835

18361836
$request = \Stormpath\Authc\Api\Request::createFromGlobals();
1837-
$result = new ApiRequestAuthenticator($application)->authenticate($request);
1837+
$result = (new ApiRequestAuthenticator($application))->authenticate($request);
18381838

1839-
$account = $result->account;
1840-
$apiKey = $result->apiKey;
1839+
$account = $result->getApiKey()->account;
1840+
$apiKey = $result->getApiKey();
18411841
```
18421842

18431843
##### Using `BasicRequestAuthenticator`
@@ -1846,10 +1846,10 @@ $apiKey = $result->apiKey;
18461846
$application = \Stormpath\Resource\Application::get("https://api.stormpath.com/v1/applications/24mp4us71ntza6lBwlu");
18471847

18481848
$request = \Stormpath\Authc\Api\Request::createFromGlobals();
1849-
$result = new BasicRequestAuthenticator($application)->authenticate($request);
1849+
$result = (new BasicRequestAuthenticator($application))->authenticate($request);
18501850

1851-
$account = $result->account;
1852-
$apiKey = $result->apiKey;
1851+
$account = $result->getApiKey()->account;
1852+
$apiKey = $result->getApiKey();
18531853
```
18541854

18551855
### OAuth Authentication
@@ -1908,10 +1908,10 @@ Host: api.trooperapp.com
19081908
$application = \Stormpath\Resource\Application::get("https://api.stormpath.com/v1/applications/24mp4us71ntza6lBwlu");
19091909

19101910
$request = \Stormpath\Authc\Api\Request::createFromGlobals();
1911-
$result = new OAuthRequestAuthenticator($application)->authenticate($request);
1911+
$result = (new OAuthRequestAuthenticator($application))->authenticate($request);
19121912

1913-
$account = $result->account;
1914-
$apiKey = $result->apiKey;
1913+
$account = $result->getApiKey()->account;
1914+
$apiKey = $result->getApiKey();
19151915
```
19161916

19171917
You can also use the more specific `OAuthBearerRequestAuthenticator` to authenticate

src/Resource/Application.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,14 @@ public function handleIdSiteCallback($responseUri)
406406

407407
$nonceStore->putNonce($jwt->irt);
408408

409+
$return = new \StdClass();
409410

410-
$account = $this->getDataStore()->getResource($jwt->sub, Stormpath::ACCOUNT);
411+
try {
412+
$account = $this->getDataStore()->getResource($jwt->sub, Stormpath::ACCOUNT);
413+
} catch (\Stormpath\Resource\ResourceError $re) {
414+
$account = null;
415+
}
411416

412-
$return = new \StdClass();
413417

414418
$return->account = $account;
415419
$return->state = $jwt->state;

src/Resource/ProviderAccountResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
class ProviderAccountResult extends Resource
2424
{
2525
const ACCOUNT = 'account';
26-
const NEW_ACCOUNT = 'newAccount';
26+
const NEW_ACCOUNT = 'isNewAccount';
2727

2828
public function __construct($dataStore = null, \stdClass $properties = null, array $options = array())
2929
{

src/Util/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020

2121
class Version
2222
{
23-
const SDK_VERSION = '1.12.0';
23+
const SDK_VERSION = '1.12.1';
2424

2525
}

tests/Authc/Api/ApiRequestAuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
use Stormpath\Authc\Api\ApiRequestAuthenticator;
55
use Stormpath\Authc\Api\Request;
6-
use Stormpath\Tests\BaseTest;
6+
use Stormpath\Tests\TestCase;
77

8-
class ApiRequestAuthenticatorTest extends BaseTest
8+
class ApiRequestAuthenticatorTest extends TestCase
99
{
1010

1111
public static $account;

tests/Authc/Api/BasicRequestAuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
use Stormpath\Authc\Api\BasicRequestAuthenticator;
55
use Stormpath\Authc\Api\Request;
6-
use Stormpath\Tests\BaseTest;
6+
use Stormpath\Tests\TestCase;
77

8-
class BasicRequestAuthenticatorTest extends BaseTest
8+
class BasicRequestAuthenticatorTest extends TestCase
99
{
1010

1111
public static $account;

tests/Authc/Api/OAuthBearerRequestAuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
use Stormpath\Authc\Api\OAuthBearerRequestAuthenticator;
66
use Stormpath\Authc\Api\OAuthClientCredentialsRequestAuthenticator;
77
use Stormpath\Authc\Api\Request;
8-
use Stormpath\Tests\BaseTest;
8+
use Stormpath\Tests\TestCase;
99

10-
class OAuthBearerRequestAuthenticatorTest extends BaseTest
10+
class OAuthBearerRequestAuthenticatorTest extends TestCase
1111
{
1212

1313
public static $account;

tests/Authc/Api/OAuthClientCredentialsAuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
use Stormpath\Authc\Api\OAuthClientCredentialsRequestAuthenticator;
55
use Stormpath\Authc\Api\Request;
66
use Stormpath\Exceptions\RequestAuthenticatorException;
7-
use Stormpath\Tests\BaseTest;
7+
use Stormpath\Tests\TestCase;
88

9-
class OAuthClientCredentialsAuthenticationTest extends BaseTest
9+
class OAuthClientCredentialsAuthenticationTest extends TestCase
1010
{
1111

1212
public static $account;

tests/Authc/Api/OAuthPasswordRequestAuthenticatorRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
namespace Stormpath\Tests\Authc\Api;
33

44
use Stormpath\Authc\Api\OAuthPasswordRequestAuthenticator;
5-
use Stormpath\Tests\BaseTest;
5+
use Stormpath\Tests\TestCase;
66

7-
class OAuthPasswordAuthenticationResult extends BaseTest
7+
class OAuthPasswordAuthenticationResult extends TestCase
88
{
99
public static $account;
1010

0 commit comments

Comments
 (0)