toshipon / oauth-php

Automatically exported from code.google.com/p/oauth-php
MIT License
0 stars 0 forks source link

Support for non-numeric usa_id_ref #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We are working on an application that supports both 2-legged oauth and
3-legged oauth. For the 2-legged, each consumer is associated with a user,
while with the 3-legged, each consumer will be associated with an
application. Since the users and applications table do not share an
auto-increment ID, I would like to prefix my usa_id_ref with 'u####' for
user consumers and 'a###' for application consumers.

Is there any reason why usa_id_ref is limited to integers? If so, is there
an alternative for supporting two types of consumers?

Original issue reported on code.google.com by timtrini...@gmail.com on 24 May 2010 at 11:10

GoogleCodeExporter commented 9 years ago
It's just because it's a foreign key, so it's usual to use integers. 

Now, I don't get exactly why you need this. Can't you create another table that 
looks
somewhat like:

CREATE TABLE something (
   id_ref INTEGER,
   legs ENUM('two', 'three')
);

You certainly have to know beforehand if it is a 2 or 3 legged auth... 

Original comment by brunobg%...@gtempaccount.com on 26 May 2010 at 7:23

GoogleCodeExporter commented 9 years ago
That makes sense, and is probably more efficient. Thanks!

Original comment by timtrini...@gmail.com on 26 May 2010 at 7:45

GoogleCodeExporter commented 9 years ago
Glad to help. Fixed!

Original comment by brunobg%...@gtempaccount.com on 26 May 2010 at 8:19