Skip to content

Commit

Permalink
Merge pull request #102 from auth0/4.x.x-dev
Browse files Browse the repository at this point in the history
4.0.0
  • Loading branch information
glena authored Aug 30, 2016
2 parents 2cfffd7 + 3c0c8ca commit 0cf9770
Show file tree
Hide file tree
Showing 43 changed files with 1,893 additions and 1,248 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ addons:
repo_token:
secure: w73sOC3Dvc5qAo/UFgA+9y8Ig3xh+fYFY45ynX9X9sSR5aH3IDBtwEu/NGpEtv7JF4TeQW/fZHMQOKybaDCn37i0lXsYqenGYofb+RHNtt8qnXhIlI7/0bll6chat7BCJ55RfyPNorTqTD+TWMqp8lKNtkm6pPhq+Arh8e5ryNw=
after_script:
- vendor/bin/test-reporter
- vendor/bin/test-reporter
script: phpunit --configuration phpunit.xml --coverage-text
33 changes: 19 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![Build Status](https://travis-ci.org/auth0/auth0-PHP.png)](https://travis-ci.org/auth0/auth0-PHP)
[![Code Climate](https://codeclimate.com/github/auth0/auth0-PHP/badges/gpa.svg)](https://codeclimate.com/github/auth0/auth0-PHP)
[![Test Coverage](https://codeclimate.com/github/auth0/auth0-PHP/badges/coverage.svg)](https://codeclimate.com/github/auth0/auth0-PHP/coverage)
[![Dependencies](https://www.versioneye.com/php/auth0:auth0-php/3.0.0/badge.svg)](https://www.versioneye.com/php/auth0:auth0-php)
[![Dependencies](https://www.versioneye.com/php/auth0:auth0-php/badge.svg)](https://www.versioneye.com/php/auth0:auth0-php)
[![HHVM Status](http://hhvm.h4cc.de/badge/auth0/auth0-php.svg)](http://hhvm.h4cc.de/package/auth0/auth0-php)
[![License](https://poser.pugx.org/auth0/auth0-php/license)](https://packagist.org/packages/auth0/auth0-php)
[![Total Downloads](https://poser.pugx.org/auth0/auth0-php/downloads)](https://packagist.org/packages/auth0/auth0-php)
Expand All @@ -31,24 +31,21 @@ Check our docs page to get a complete guide on how to install it in an existing
```
require __DIR__ . '/vendor/autoload.php';
use Auth0\SDK\Auth0;
use Auth0\SDK\API\Authentication;
$domain = 'YOUR_NAMESPACE';
$client_id = 'YOUR_CLIENT_ID';
$client_secret = 'YOUR_CLIENT_SECRET';
$redirect_uri = 'http://YOUR_APP/callback';
$auth0 = new Auth0(array(
'domain' => $domain,
'client_id' => $client_id,
'client_secret' => $client_secret,
'redirect_uri' => $redirect_uri
));
$auth0 = new Authentication($domain, $client_id);
$profile = $auth0->getUser();
$oAuthClient = $auth0->get_oauth_client($client_secret, $redirect_uri);
$profile = $oAuthClient->getUser();
if (!$profile) {
$authorize_url = "https://$domain/authorize?response_type=code&scope=openid&client_id=$client_id&redirect_uri=http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] ;
$authorize_url = $auth0->get_authorize_link('code', 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
header("Location: $authorize_url");
exit;
Expand All @@ -64,12 +61,12 @@ var_dump($profile);
```
require __DIR__ . '/vendor/autoload.php';
use Auth0\SDK\Auth0Api;
use Auth0\SDK\API\Management;
$token = "eyJhbGciO....eyJhdWQiOiI....1ZVDisdL...";
$domain = "account.auth0.com";
$auth0Api = new Auth0Api($token, $domain);
$auth0Api = new Management($token, $domain);
$usersList = $auth0Api->users->search([ "q" => "[email protected]" ]);
Expand All @@ -81,13 +78,13 @@ var_dump($usersList);
```
require __DIR__ . '/vendor/autoload.php';
use Auth0\SDK\Auth0AuthApi;
use Auth0\SDK\API\Authentication;
$domain = "account.auth0.com";
$client_id = '...';
$client_secret = '...'; // This is optional, only needed for impersonation or t fetch an access token
$auth0Api = new Auth0AuthApi($domain, $client_id, $client_secret);
$auth0Api = new Authentication($domain, $client_id, $client_secret);
$tokens = $auth0Api->authorize_with_ro('[email protected]','thepassword');
Expand Down Expand Up @@ -119,6 +116,14 @@ This package uses composer for mantianing dependencies. However, if you cannot u

### *NOTICE* Backward compatibility breaks

#### 4.0

- Soon to deprecate the following clases:
+ Auth0\SDK\Auth0: use \Auth0\SDK\API\Authentication or \Auth0\SDK\API\Oauth2Client instead
+ Auth0\SDK\Auth0Api: use \Auth0\SDK\API\Management instead
+ Auth0\SDK\Auth0AuthApi: use \Auth0\SDK\API\Authentication instead
+ Auth0\SDK\Auth0JWT: Use \Auth0\SDK\JWTVerifier instead

#### 3.2
- Now the SDK supports RS256 codes, it will decode using the `.well-known/jwks.json` endpoint to fetch the public key

Expand Down
1 change: 1 addition & 0 deletions examples/basic-oauth/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'client_secret' => getenv('AUTH0_CLIENT_SECRET'),
'redirect_uri' => getenv('AUTH0_CALLBACK_URL'),
'persist_id_token' => true,
'persist_refresh_token' => true,
));

$userInfo = $auth0Oauth->getUser();
Expand Down
2 changes: 1 addition & 1 deletion examples/basic-oauth/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(document).ready(function() {
callbackURL: AUTH0_CALLBACK_URL
, responseType: 'code'
, authParams: {
scope: 'openid'
scope: 'openid offline_access'
}
});

Expand Down
17 changes: 17 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit bootstrap="./tests/bootstrap.php"
colors="true">
<testsuites>
<testsuite>
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src</directory>
<exclude>
<directory suffix="Interface.php">src/</directory>
</exclude>
</whitelist>
</filter>
</phpunit>
Loading

0 comments on commit 0cf9770

Please sign in to comment.