Code Monkey home page Code Monkey logo

Comments (20)

jnbdz avatar jnbdz commented on May 22, 2024

I ran into the same problem.

To debug it I just comment out the code that was causing issue. To try to get to the root of the problem.

Then I found multiple bugs:

  1. First is the models call

            $this->authserver = new League\OAuth2\Server\Authorization(
                     new League\OAuth2\Server\Storage\PDO\Client($db),
                     new League\OAuth2\Server\Storage\PDO\Session($db),
                     new League\OAuth2\Server\Storage\PDO\Scope($db)
             );
    

That's the solution... This is found in the __construct method.

  1. The next bug is found on line 30.

    $this->authserver->addGrantType(new League\OAuth2\Server\Grant\AuthCode($this->authserver));

I am not sure this is the solution... But it stop the error message for this.

  1. Now to debug the first problem.

Solutions:

 'error'                 => $this->authserver->getExceptionType($e->getCode()),

Then you will incouter another error... Here is the solution:

 header($this->authserver->getExceptionHttpHeaders($this->authserver->getExceptionType($e->getCode())));

I hope it helps.

By the way you will encounter another problem.

Non-library specific error.

I am trying to figure it out.

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

The next problem I got as to do with the $server variable. That is for some reason undefined.

The the $server var is supposed to have this value: $this->authserver.

Now I am still incoutering some issues. I am not sure I understand them... But when I do I will add new information.

from oauth2-server.

 avatar commented on May 22, 2024

Thanks fella for looking into it.

Does this mean that taking care of one issue raises another and you still have not been able to make it work from the wiki ?

I am not able to atleast :( ...

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

The problem is that I am not sure how to test out the code to see if everything is ok.

from oauth2-server.

 avatar commented on May 22, 2024

Why is not the creator to this package helping us out ? I am sure he is the best person to sort this through :(

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

Busy... Who knows. But I am trying different things on my server. When I get it to work I will explain here how I did it.

from oauth2-server.

 avatar commented on May 22, 2024

Okay, that would be great. Amazing no one has found this out before. It's the first tutorial in the wiki ...

from oauth2-server.

esolitos avatar esolitos commented on May 22, 2024

The wiki is sort of a "pseudocode", you need to set it up based on your Framework.
For example I'm modifying it to work with CodeIgniter, I still have some issues, but it seems to work.

from oauth2-server.

 avatar commented on May 22, 2024

Help me out with Laravel then :( ... Anyone ?

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

I am! Today I some things to do. But tonight I will be working on it. And when I am done I will give more details on how to setup this package with Laravel 4.

Right now I am trying out OAuth2-client so that I can test it out with OAuth2-server.

The problem is that this package is just a framework to help you create a OAuth2-server. It does not have all the views and other things. You have to coded yourself. The reason, I think, it was to make this package as framework agnostic as possible. But trust me when I am done I will put a link to my GitHub with all the details.

from oauth2-server.

alexbilbie avatar alexbilbie commented on May 22, 2024

Guys, sorry I haven't helped out much, I've just started a new job, am moving house and have no Internet connection yet. Please bear with me.

Emailing from my iPhone like a BOSS

On 3 Jun 2013, at 22:46, Jean-Nicolas Boulay [email protected] wrote:

I am! Today I some things to do. But tonight I will be working on it. And when I am done I will give more details on how to setup this package with Laravel 4.

Right now I am trying out OAuth2-client so that I can test it out with OAuth2-server.

The problem is that this package is just a framework to help you create a OAuth2-server. It does not have all the views and other things. You have to coded yourself. The reason, I think, it was to make this package as framework agnostic as possible. But trust me when I am done I will put a link to my GitHub with all the details.


Reply to this email directly or view it on GitHub.

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

@alexbilbie should I continue figuring it out? Or will you post updates that will make what I do obsolete?

@developernoman another thing. Your controller should extend: "BaseController".

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

@developernoman if you're using oauth2-client with Laravel 4, you will need to debug it to make it work. Here is how: thephpleague/oauth2-client#5

I will continue tomorrow...

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

In the OAuth2-client Provider folder I added my own provider PHP script.

But every time I try to connect to my oauth-server I get an error.

So there seems to be a bug with the controller that I have created in the oauth-server side... Or there is something else bugging.

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

It seems that there is another problem with the tutorial. Again I am not sure.

But in section "Create your first client" of the wiki it says to put data in "oauth_clients" db table.

I found that it did not work. So I did some digging and found that I had too add the client_id and redirect_uri to the "oauth_client_endpoints" db table.

It's weird because the way it is written in the wiki it seems it's just optional.

I am now getting this error: "The requested scope is invalid, unknown, or malformed. Check the "offline_access,email,read_stream" scope."

I will try to solve it tonight but no guarantees.

from oauth2-server.

alexbilbie avatar alexbilbie commented on May 22, 2024

Regarding the scope error you should delimite your scopes with a space not a comma unless you override it.

Emailing from my iPhone like a BOSS

On 6 Jun 2013, at 07:59, Jean-Nicolas Boulay [email protected] wrote:

It seems that there is another problem with the tutorial. Again I am not sure.

But in section "Create your first client" of the wiki it says to put data in "oauth_clients" db table.

I found that it did not work. So I did some digging and found that I had too add the client_id and redirect_uri to the "oauth_client_endpoints" db table.

It's weird because the way it is written in the wiki it seems it's just optional.

I am now getting this error: "The requested scope is invalid, unknown, or malformed. Check the "offline_access,email,read_stream" scope."

I will try to solve it tonight but no guarantees.


Reply to this email directly or view it on GitHub.

from oauth2-server.

jnbdz avatar jnbdz commented on May 22, 2024

It works.

from oauth2-server.

quasiperfect avatar quasiperfect commented on May 22, 2024

@esolitos can you be so kind and tell me how you got it to work with CodeIgniter ?

from oauth2-server.

esolitos avatar esolitos commented on May 22, 2024

Hi QuasiPerfect, right now I don't remember the steps, anyway you have to change a looooot of things.
Take the tutorial as a pseudo-code and think what he's doing. After that you should be able to rewrite the tutorial code as you need it, imho don't try to copy-paste: Start over, it's easier.
If you still have issues I'll give a look to my code.

from oauth2-server.

alexbilbie avatar alexbilbie commented on May 22, 2024

I'm closing this because there are going to be some updated docs in the wiki.

from oauth2-server.

Related Issues (20)

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.