Giter VIP home page Giter VIP logo

samples-php's Issues

Tutorial is incompatible with default authorization servers - okta-hosted-login

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.

Wrong Object Type for Keys

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

/vendor/autoload.php

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"

Filesystem loader isn't found.

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

simple issue when run on localhost.

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

Debuging "Error fetching access token"

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.

Verification of JWT failed

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?

Redirecting to 404 error on custom login

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.