php-api-auth icon indicating copy to clipboard operation
php-api-auth copied to clipboard

Error: text: "Could not find configuration: default / default"

Open MaccerC opened this issue 6 years ago • 5 comments

Trying to get auth.php to work I get this error: text: "Could not find configuration: default / default"

This is the code I'm using: http.post('/auth.php', { username: username, password: password });

What am I doing wrong?

Furthermore: At the end of auth.php username and password are both returned as 'admin'. Do I have to change that or can I leave this empty? I don't get it, sorry.

MaccerC avatar Sep 11 '19 09:09 MaccerC

I have the same problem. The php-api-xxx is a great serious libraries but the problem is it does not have a simple, straight forward How to use tutorial(s)!

I want to use auth beside of the api.php but I don't know how to combine them!

mjza avatar Apr 06 '20 09:04 mjza

There is an example in the folder 'examples/clients/auth.php/', does that help?

mevdschee avatar Apr 06 '20 15:04 mevdschee

Not really. It has only an html file! I have these questions:

  1. What should be the structure of the user table?
  2. Where to put auth.php file? Beside of the api.php?
  3. How does the api.php know about the auth.php? I made the changes in the configuration as said in the readme file, but I see the above error!

mjza avatar Apr 07 '20 07:04 mjza

@mevdschee OK. I have put the auth.php and login.php at the same folder of the examples/clients/auth.php/. By calling the http://localhost:8080/examples/clients/auth.php/vanilla.html it will redirect to login.php and after a login it will return back!

mjza avatar Apr 07 '20 07:04 mjza

Hello all! i found some little issues, whent fixed i got it worked for me.

1 replace this: $audience = isset($_GET['audience']) ? $_GET['audience'] : 'default'; by: $audience = isset($_GET['audience']) ? $_GET['audience'] : 'api.php';

so that configuration will be default / api.php (client_id / audience) based on this: main([ 'default' => [ 'api.php' => [.............................

2 in the config replace: 'redirects' => 'http://localhost/[folder]/vanilla.html', by 'redirectUri' => 'http://localhost/[folder]/vanilla.html',

and that is it.

i hope it helps

okobsamoht avatar Feb 02 '21 12:02 okobsamoht