Skip to content
Snippets Groups Projects
Commit f1ca94ea authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg
Browse files

Fix readline for OAuth demo

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1705 44740490-163a-0410-bde0-09ae8108e29a
parent f98f03c9
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env php
<?php
function readline($prompt = '') {
echo $prompt;
return rtrim( fgets( STDIN ), "\n" );
}
/* This is the base directory of the simpleSAMLphp installation. */
$baseDir = dirname(dirname(dirname(dirname(__FILE__))));
......@@ -27,8 +33,7 @@ $url = $consumer->getAuthorizeRequest($baseurl . '/module.php/oauth/authorize.ph
echo('Go to this URL to authenticate/authorize the request: ' . $url . "\n");
system('open ' . $url);
echo('Waiting 15 seconds for you to complete the authorization...' . "\n");
sleep(15);
readline('Click enter when you have completed the authorization step using your web browser...');
// Replace the request token with an access token
$accessToken = $consumer->getAccessToken( $baseurl . '/module.php/oauth/accessToken.php', $requestToken);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment