Esempio n. 1
0
<?php

require_once 'auth0/vendor/autoload.php';
require_once 'auth0/src/Auth0.php';
require_once 'auth0/vendor/adoy/oauth2/vendor/autoload.php';
require_once 'auth0/client/config.php';
use Auth0SDK\Auth0;
$auth0 = new Auth0(array('domain' => $auth0_cfg['domain'], 'client_id' => $auth0_cfg['client_id'], 'client_secret' => $auth0_cfg['client_secret'], 'redirect_uri' => $auth0_cfg['redirect_uri']));
$token = $auth0->getAccessToken();
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php 
wp_title(' - ', true, 'right');
?>
</title>
<meta name="description" content="">
<meta name="author" content="">

	<?php 
wp_head();
?>
	<script type="text/javascript">
		var ajaxUrl = "<?php 
bloginfo('wpurl');
?>
/wp-admin/admin-ajax.php";
	</script>
Esempio n. 2
0
<?php

require_once 'vendor/autoload.php';
require_once '../src/Auth0.php';
require_once '../vendor/adoy/oauth2/vendor/autoload.php';
require_once 'config.php';
use Auth0SDK\Auth0;
$auth0 = new Auth0(array('domain' => $auth0_cfg['domain'], 'client_id' => $auth0_cfg['client_id'], 'client_secret' => $auth0_cfg['client_secret'], 'redirect_uri' => $auth0_cfg['redirect_uri']));
$token = $auth0->getAccessToken();
?>
<!doctype html>
<?php 
if (!$token) {
    ?>
    <!-- PUT YOUR Auth0 HTML/JS CODE HERE -->
	<script id="auth0" src="https://sdk.auth0.com/auth0.js#client=6ZwZEUo2ZK4c50aLPpgupeg5v2Ffxp9P&amp;state=http://cloudspokes.wpengine.com/&amp;redirect_uri=http://beta.topcoder.com"></script>

   <script>
     $(function () {
           $('.actionLogin').click( function () {
                  ({ onestep: true, 
                 						title: "TopCoder", 
                 						icon: 'http://www.topcoder.com/i/24x24_brackets.png', 
                 						showIcon: true,
                 						showForgot: true,
    									forgotText: "Forgot Password?",
    									forgotLink: "https://www.topcoder.com/..."
                 					});
           });
       });
                          
Esempio n. 3
0
<?php

error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once '../../vendor/autoload.php';
require_once 'config.php';
use Auth0SDK\Auth0;
$auth0 = new Auth0(array('domain' => $auth0_cfg['domain'], 'client_id' => $auth0_cfg['client_id'], 'client_secret' => $auth0_cfg['client_secret'], 'redirect_uri' => $auth0_cfg['redirect_uri'], 'debug' => true));
$auth0->setDebugger(function ($info) {
    file_put_contents("php://stdout", sprintf("\n[%s] %s:%s [%s]: %s\n", date("D M j H:i:s Y"), $_SERVER["REMOTE_ADDR"], $_SERVER["REMOTE_PORT"], "---", $info));
});
$token = $auth0->getAccessToken();
if ($token) {
    header('Location: /');
} else {
    print 'Oops! :(';
}
Esempio n. 4
0
<?php

require_once '../../vendor/autoload.php';
require_once 'config.php';
use Auth0SDK\Auth0;
$auth0 = new Auth0(array('domain' => $auth0_cfg['domain'], 'client_id' => $auth0_cfg['client_id'], 'client_secret' => $auth0_cfg['client_secret'], 'redirect_uri' => $auth0_cfg['redirect_uri']));
$userInfo = $auth0->getUserInfo();
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Testing Auth0 PHP</title>
</head>
<body>
<?php 
if (!$userInfo) {
    ?>
    <script src="https://d19p4zemcycm7a.cloudfront.net/w2/auth0-widget-2.3.min.js"></script>
    <script type="text/javascript">
        var widget = new Auth0Widget({
            domain:         "<?php 
    echo $auth0->getDomain();
    ?>
",
            clientID:       "<?php 
    echo $auth0->getClientId();
    ?>
",
            callbackURL:    "<?php 
    echo $auth0->getRedirectUri();