gcode-mirror / oauth-php

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

Problem in "addConsumerRequestToken" in OAuthStoreMySQL : Field 'ost_referrer_host' doesn't have a default value #65

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi, thank you for this usefull library.

I'm working on a client/server mobile app using oauth-php server side and 
oauth-signpost as client (android).

I have a problem when I try to get a request token, in the last query of 
"addConsumerRequestToken" the server answers :

SQL Error in OAuthStoreMySQL: Field 'ost_referrer_host' doesn't have a default 
value

Here is the query :

INSERT INTO oauth_server_token
SET ost_osr_id_ref = 2,
ost_usa_id_ref= 1,
ost_token='7f9c11f14f24d78e63c6dbcb3e3e599a04c91d2ac',
ost_token_secret= 'fae9e85788f52e331e19cd98951972f6',
ost_token_type= 'request',
ost_token_ttl = DATE_ADD(NOW(), INTERVAL 3600 SECOND),
ost_callback_url = 'oob'
ON DUPLICATE KEY UPDATE
ost_osr_id_ref= VALUES(ost_osr_id_ref),
ost_usa_id_ref= VALUES(ost_usa_id_ref),
ost_token= VALUES(ost_token),
ost_token_secret= VALUES(ost_token_secret),
ost_token_type= VALUES(ost_token_type),
ost_token_ttl = VALUES(ost_token_ttl),
ost_callback_url    = VALUES(ost_callback_url),
tost_timestamp= NOW()

I didn't find any information or existing issue on this "bug", maybe I made a 
mistake in the consumer registration.

If any one have an idea.

Thanks!

Original issue reported on code.google.com by mathieu....@gmail.com on 16 Sep 2010 at 8:40

GoogleCodeExporter commented 9 years ago
Thanks a lot. Fixed on r156.

Your can fix it easily by running this on your MySQL:

ALTER TABLE oauth_server_token MODIFY ost_referrer_host varchar(128) not null 
default '';

Original comment by brunobg%...@gtempaccount.com on 16 Sep 2010 at 3:47