oauth2-server-php-docs icon indicating copy to clipboard operation
oauth2-server-php-docs copied to clipboard

User credentials grant incompatible with the oauth_clients table constraints

Open bshaffer opened this issue 11 years ago • 1 comments
trafficstars

from @jgoux

Hello, I want to implement the User credentials grant with your library (which is excellent :D) I have an issue with the constraints set on the oauth_clients table. In the doc, you give this query to create the oauth_clients table :

CREATE TABLE oauth_clients (client_id VARCHAR(80) NOT NULL, client_secret VARCHAR(80) NOT NULL, redirect_uri VARCHAR(2000) NOT NULL, grant_types VARCHAR(80), scope VARCHAR(100), user_id VARCHAR(80), CONSTRAINT client_id_pk PRIMARY KEY (client_id));

As my client is public, I don't need to associate a client_secret to it, and as I want to use the User credentials grant, I don't need to set a redirect_uri either. So maybe client_secret and redirect_uri don't need the NOT NULL constraint by default.

bshaffer avatar May 17 '14 01:05 bshaffer

Maybe I'm misunderstanding the oAuth protocol or the implementation this library offers, so please correct me if I'm wrong.

I thought the oauth_users table is intended for the user credentials grant, not oauth_clients.

What I am wondering is if oauth_clients (used for the client credentials grant) should have a redirect_uri field in the first place. It only seems to be used in the Authorization Code grant type.

ghost avatar Feb 12 '18 16:02 ghost