Created
June 18, 2013 06:14
-
-
Save ndv/5803020 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a state token to prevent request forgery. | |
// Store it in the session for later validation. | |
$state = md5(rand()); | |
$app['session']->set('state', $state); | |
// Set the client ID, token state, and application name in the HTML while | |
// serving it. | |
return $app['twig']->render('index.html', array( | |
'CLIENT_ID' => CLIENT_ID, | |
'STATE' => $state, | |
'APPLICATION_NAME' => APPLICATION_NAME | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment