okta / samples-php Goto Github PK
View Code? Open in Web Editor NEWsamples-php
Home Page: https://github.com/okta/samples-php
License: Apache License 2.0
samples-php
Home Page: https://github.com/okta/samples-php
License: Apache License 2.0
https://github.com/okta/samples-php/tree/develop/okta-hosted-login
This tutorial uses a default authorization server, which works in a free okta dev account. However it depends on okta-jwt-verifier-php which is incompatible with default authorization server in a production account.
It is unclear to me how that is possible, but I am looking for a recommendation on how to set up authentication with OIDC, OKTA, PHP, and the default authorization server, in a production environment.
Can you point me to documentation, or a code example that will work for my use case?
Thanks,
Aidan.
I may be doing something wrong but I ran into an issue with the jwt-verifier where it didn't like the object type being passed in. I'm running PHP 7.4 which may be stricter.
vendor/okta/jwt-verifier/src/JwtVerifier.php
$keys = $this->adaptor->getKeys($this->metaData->jwks_uri);
foreach($keys as $id => $key) {
$keys[$id] = new Key($key, 'RS256');
}
$decoded = $this->adaptor->decode($jwt, $keys);
If I don't convert the items explicitly to the Key type I get an error because the array is a list of: OpenSSL key resource
Which seems to be coming from the use of
openssl_pkey_get_public
which is in
vendor/okta/jwt-verifier/src/Adaptors/FirebasePhpJwt.php
in the parseKey function
Similar to this issue posted for Golang and the issue reported on the Okta forums, I'm experiencing a 404 error when clicking the Login button. mod_rewrite is enabled. Running locally: Apache/2.4.39 (Win32) PHP/7.2.22. Error as follows:
URL (after clicking Login): http://localhost:8080/login
Not Found
The requested URL /login was not found on this server.
Hi Brian,
I'm trying to install this but when I ran command "> composer server:start", it just returns this line "> php -S 127.0.0.1:8080 -t . index.php" and then froze. Nothing happens. Did I miss anything?
Centos 7
Apache 2.4.10
PHP 7.1.16
Thanks,
when i am start to using your recommended simple php file then i have found error failed to open stream: No such file or directory "/vendor/autoload.php"
So far, I've been able to do everything up through accessing the login page...
Now, I'm getting issues when starting the okta hosted and custom login.
$ composer server:start
> php -S 127.0.0.1:8080 -t ./ ./index.php
[Mon Dec 7 09:59:01 2020] PHP 7.4.3 Development Server (http://127.0.0.1:8080) started
Good, right? Now I go to localhost:8080
only to find that the page has no content, just some HTML and Body tags. I also get some of this in the terminal:
[Mon Dec 7 10:03:12 2020] 127.0.0.1:39470 Accepted
[Mon Dec 7 10:03:12 2020] PHP Fatal error: Uncaught Error: Class 'Twig_Loader_Filesystem' not found in /path/to/samples-php-develop/okta-hosted-login/index.php:20
Stack trace:
#0 {main}
thrown in /path/to/samples-php-develop/okta-hosted-login/index.php on line 20
[Mon Dec 7 10:03:12 2020] 127.0.0.1:39470 Closing
Running on Ubuntu 20.04
Hi Team,
It shows error Twig_Loader_Filesystem while trying to run http://127.0.0.1:8080/ after running composer sample:custom-login.
Need your urgent help.
Thanks
when I click login button.
it shows this error
HP Fatal error: Uncaught Error: Call to undefined function Jose\KeyConverter\gmp_strval()
and if I refresh,
it shows this message
Could not exchange code for an access token
The README for the "Okta Hosted Login" demo app has a link with no URL that is not rendering correctly in Markdown:
"This is done from the Okta Developer Console and you can find instructions [here][OIDC WEB Setup Instructions]."
See https://github.com/okta/samples-php/blame/develop/okta-hosted-login/README.md#L9
That link would have been very useful to me in my research on how to integrate with Okta.
Hello,
I'm not actually a PHP developer, but I'm just trying to help my team.
After the OKTA login successful, we receive the message from the title of this issue.
if(!isset($response->access_token)) {
die('Error fetching access token');
}
If you are in this situation, on what you should look first? Or how you debug this?
In any case, is it possible that the metadata url of OKTA has been changed recently?
Regards.
I'm getting this error when I'm trying to test the examples on Windows 10.
My setup is:
Apache 2.4
PHP 7.4.9
Any ideas why this is happening?
Sweep through readme and code to make sure labels and placeholders follow the pattern here: https://oktawiki.atlassian.net/wiki/spaces/UX/pages/470681125/Developer+Experience+-+Okta+Domain+Labels
https://{yourOktaDomain}
(not https://{yourOktaDomain}.com
){clientId}
{clientSecret}
Hi!
Just wondering if you could please point me in the right direction?
I'm consistently being redirected to a 404 error page on my dev-xxxx-admin.oktapreview.com.
The app loads successfully, I click "login" and am redirected to a login prompt. This correctly stops me if incorrect, but if the credentials are correct I see a 404 error with an attempt at accessing the callback url.
This 404 url ends with scope=openid email
which is encoded with a %2520 in the space.
This appears to be breaking the callback page.
Any advice?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.