-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with authorization_endpoint #4
Comments
That probably means it couldn't fetch the server metadata. Double check you've included the right issuer URL and that the metadata URL of the server exists. |
Hi, i tried the latest version of the demo php but i get " Error fetching access token". Jan 03 20:14:30 | login okta (PublicClientApp) | OAuth2 access token is grantedsuccess | (User)Access Token (access_token) but my redircet page is blank here my code `<?php $client_id = 'MYID'; if(isset($_GET['logout'])) { if(isset($_SESSION['sub'])) { Logged in as ';echo ' ' . $_SESSION['username'] . ' ';echo ''; die(); } $metadata = http($metadata_url); if(!isset($_GET['code'])) { $_SESSION['state'] = bin2hex(random_bytes(5)); $authorize_url = $metadata->authorization_endpoint.'?'.http_build_query([ echo ' Not logged in ';echo ''; } else { if($_SESSION['state'] != $_GET['state']) { if(isset($_GET['error'])) { $response = http($metadata->token_endpoint, [ if(!isset($response->access_token)) { $userinfo = http($metadata->userinfo_endpoint, [ if($userinfo->sub) { } // Base64-urlencoding is a simple variation on base64-encoding function http($url, $params=false) { |
The demo does not work locally for me. Using php 7.4.
I tried the latest and the original version of the demo php here and I get basically the same error in both cases.
In the console, i see this error:
[Thu Dec 31 09:17:46 2020] PHP Notice: Trying to get property 'authorization_endpoint' of non-object in C:\oauth-demo\index.php on line 70
[Thu Dec 31 09:17:46 2020] [::1]:54923 [200]: GET /?response_type=code....
The text was updated successfully, but these errors were encountered: