ocastalabs / couchdb-xo_auth Goto Github PK
View Code? Open in Web Editor NEWAuthorisation module for CouchDB against external OAuth providers (e.g. Twitter, Facebook)
Authorisation module for CouchDB against external OAuth providers (e.g. Twitter, Facebook)
I have tested it on couchDB 1.4. Redirecting after FB login to _fb doesnt seems to work. (Gives illegal database name error)
Any workaround to make it compatible with 1.4?
I'm sending the user to /_fb so it can be added to _users table, but I get this error.
{
error: "unknown_error",
reason: "undef"
}
I have couchdb 1.6.0
Any help?
Thanks! :)
Hi, again! I wrote a BrowserID plugin that does much the same as this project. (It actually uses some code from the old facebook auth plugin.)
https://github.com/iriscouch/browserid_couchdb
Building an application using it is extremely easy: https://github.com/iriscouch/browserid_couchdb/blob/master/example/page.tmpl.html
Are you interested in merging the BrowserID work into this project? Thanks.
The README says client_id
, client_secret
, but the code looks for consumer_key
, consumer_secret
.
Hey guys.
Firstly thank you for such amazing plugin. It's awesome ๐
Next I want to ask for your help with small tuning. I'm trying to save Facebook's response from "/me" to user's document. Once you already fetched it while authenticating user, why not to safe it to user's document right away? Since new public_fields
config option was introduced in 1.4.0 it is possible to use _users
db as the primary storage for users' profiles, so my tweak may come in handy I suppose.
I'm not a pro in Erlang or any other functional lng, so after some digging I came here with complete misunderstanding of how to put FBInfo
or even Body
(xo_auth_fb.erl@95) into ServiceDetails1
(xo_auth.erl@169). I mean I've coded a bit and can see FBInfo as an argument to new update_service_details/6
, but when I'm trying to put it between ACCESS_TOKEN and ACCESS_TOKEN_SECRET everything won't work. I'm pretty sure, that this all because of wrong data format.
Trying to save FBInfo
without wrapping it into ?l2b() I broke Couch and now can't open any new users in Futon because of some internal failure. So please help me to don't break anything else and keep my couch working as stable as always.
Hi. Thanks very much for your work on this!
I used the previous incarnation, CouchDB-Facebook-Authentication, but I had converted it to rebar. I never sent a merge request, but the commit history is here (it's pretty straightforward). https://github.com/iriscouch/CouchDB-Facebook-Authentication/commits/master
Are you interested in converting this project to rebar? Rebar is becoming standard and ubiquitous in Erlang projects, so it would make this project more idiomatic.
Thoughts? Thanks!
Hi folks,
I've been using your excellent Couchdb plugin for logmykidsoff.com for a while now. I want to upgrade couchdb to v 1.3.1, though I note you have tested the current code only for 1.3.0.
I tried the latest CouchDB-XO_Auth out and can no longer login via either Twitter or Facebook. Couchdb produces an error trace like this:
[Mon, 10 Feb 2014 16:03:29 GMT] [error] [<0.17166.0>] Uncaught error in HTTP request: {error,undef}
[Mon, 10 Feb 2014 16:03:29 GMT] [info] [<0.17166.0>] Stacktrace: [{couch_view,get_map_view,
[{db,<0.127.0>,<0.128.0>,nil,
<<"1392034832142846">>,<0.129.0>,
<0.126.0>,<0.130.0>,
{db_header,6,1935,0,
{112154,{40,73,37261},44797},
{112912,113,6197},
nil,0,nil,nil,1000},
1935,
{btree,<0.126.0>,
{112154,{40,73,37261},44797},
#Fun<couch_db_updater.10.55895019>,
#Fun<couch_db_updater.11.100913286>,
#Fun<couch_btree.5.25288484>,
#Fun<couch_db_updater.12.39068440>,
snappy},
{btree,<0.126.0>,
{112912,113,6197},
#Fun<couch_db_updater.13.114276184>,
#Fun<couch_db_updater.14.2340873>,
#Fun<couch_btree.5.25288484>,
#Fun<couch_db_updater.15.23651859>,
snappy},
{btree,<0.126.0>,nil,
#Fun<couch_btree.3.20686015>,
#Fun<couch_btree.4.73514747>,
#Fun<couch_btree.5.25288484>,nil,snappy},
1935,<<"_users">>,
"/usr/local/var/lib/couchdb/_users.couch",
[#Fun<couch_doc.8.106888048>],
[],nil,
{user_ctx,null,[<<"_admin">>],undefined},
nil,1000,
[before_header,after_header,on_file_open],
[{before_doc_update,
#Fun<couch_users_db.before_doc_update.2>},
{after_doc_read,
#Fun<couch_users_db.after_doc_read.2>},
sys_db,
{user_ctx,
{user_ctx,null,
[<<"_admin">>],
undefined}},
nologifmissing,sys_db],
snappy,
#Fun<couch_users_db.before_doc_update.2>,
#Fun<couch_users_db.after_doc_read.2>},
<<"_design/xo_auth">>,<<"xrefbyid">>,nil]},
{xo_auth,query_xref_view,3},
{xo_auth,check_user_database,2},
{xo_auth,determine_username,4},
{xo_auth_fb,create_or_update_user,5},
{xo_auth_fb,handle_fb_req,1},
{couch_httpd,handle_request_int,5},
{mochiweb_http,headers,5}]
[Mon, 10 Feb 2014 16:03:29 GMT] [info] [<0.17166.0>] 31.25.190.168 - - GET /_fb?code=*snip_a_great_long_code* 500
[Mon, 10 Feb 2014 16:03:29 GMT] [error] [<0.17166.0>] httpd 500 error response:
{"error":"unknown_error","reason":"undef"}
This occurs after authenticating externally with facebook.
Something similar occurs with an attempt to login via Twitter:
[Mon, 10 Feb 2014 16:10:31 GMT] [info] [<0.17763.0>] 31.25.190.168 - - GET /_twitter 302
[Mon, 10 Feb 2014 16:10:35 GMT] [error] [<0.17783.0>] Uncaught error in HTTP request: {error,undef}
[Mon, 10 Feb 2014 16:10:35 GMT] [info] [<0.17783.0>] Stacktrace: [{couch_view,get_map_view,
[{db,<0.127.0>,<0.128.0>,nil,
<<"1392034832142846">>,<0.129.0>,
<0.126.0>,<0.130.0>,
{db_header,6,1935,0,
{112154,{40,73,37261},44797},
{112912,113,6197},
nil,0,nil,nil,1000},
1935,
{btree,<0.126.0>,
{112154,{40,73,37261},44797},
#Fun<couch_db_updater.10.55895019>,
#Fun<couch_db_updater.11.100913286>,
#Fun<couch_btree.5.25288484>,
#Fun<couch_db_updater.12.39068440>,
snappy},
{btree,<0.126.0>,
{112912,113,6197},
#Fun<couch_db_updater.13.114276184>,
#Fun<couch_db_updater.14.2340873>,
#Fun<couch_btree.5.25288484>,
#Fun<couch_db_updater.15.23651859>,
snappy},
{btree,<0.126.0>,nil,
#Fun<couch_btree.3.20686015>,
#Fun<couch_btree.4.73514747>,
#Fun<couch_btree.5.25288484>,nil,snappy},
1935,<<"_users">>,
"/usr/local/var/lib/couchdb/_users.couch",
[#Fun<couch_doc.8.106888048>],
[],nil,
{user_ctx,null,[<<"_admin">>],undefined},
nil,1000,
[before_header,after_header,on_file_open],
[{before_doc_update,
#Fun<couch_users_db.before_doc_update.2>},
{after_doc_read,
#Fun<couch_users_db.after_doc_read.2>},
sys_db,
{user_ctx,
{user_ctx,null,
[<<"_admin">>],
undefined}},
nologifmissing,sys_db],
snappy,
#Fun<couch_users_db.before_doc_update.2>,
#Fun<couch_users_db.after_doc_read.2>},
<<"_design/xo_auth">>,<<"xrefbyid">>,nil]},
{xo_auth,query_xref_view,3},
{xo_auth,check_user_database,2},
{xo_auth,determine_username,4},
{xo_auth_twitter,create_or_update_user,2},
{xo_auth_twitter,handle_twitter_req,1},
{couch_httpd,handle_request_int,5},
{mochiweb_http,headers,5}]
[Mon, 10 Feb 2014 16:10:35 GMT] [info] [<0.17783.0>] 31.25.190.168 - - GET /_twitter?oauth_token=*snip_token*&oauth_verifier=*snip_verifier* 500
[Mon, 10 Feb 2014 16:10:35 GMT] [error] [<0.17783.0>] httpd 500 error response:
{"error":"unknown_error","reason":"undef"}
Does anything jump out as being obvious?
regards,
Seb
Noticed this when compiling with R16B3-3:
src/xo_auth_twitter.erl:192: Warning: crypto:blowfish_cfb64_encrypt/3 is deprecated and will be removed in in a future release; use crypto:block_encrypt/4
src/xo_auth_twitter.erl:199: Warning: crypto:blowfish_cfb64_decrypt/3 is deprecated and will be removed in in a future release; use crypto:block_decrypt/4
That's it really - how can I get access to the debug messages?
Thanks,
Seb
[Fri, 30 Mar 2012 01:51:31 GMT] [debug] [<0.4229.0>] request_facebook_graphme_info response={ok,"200",
[{"Access-Control-Allow-Origin",
"*"},
{"Cache-Control",
"private, no-cache, no-store, must-revalidate"},
{"Content-Type",
"text/javascript; charset=UTF-8"},
----snip-----
{"X-Cnection",
"close"},
{"Date",
"Fri, 30 Mar 2012 01:51:30 GMT"},
{"Content-Length",
"50"}],
"{"id":"100001676421210","username":"gert.cuykens"}"}
[Fri, 30 Mar 2012 01:38:42 GMT] [error] [<0.2598.0>] Uncaught error in HTTP request: {error,undef}
[Fri, 30 Mar 2012 01:38:42 GMT] [info] [<0.2598.0>] Stacktrace: [{couch_view,get_map_view,
[{db,<0.98.0>,<0.99.0>,nil,
<<"1333066879927227">>,<0.101.0>,<0.97.0>,
<0.102.0>,
{db_header,6,5,0,
{16521,{3,1,2233},294},
{16815,4,233},
nil,0,nil,nil,1000},
5,
{btree,<0.97.0>,
{16521,{3,1,2233},294},
#Fun<couch_db_updater.10.55895019>,
#Fun<couch_db_updater.11.100913286>,
#Fun<couch_btree.5.16030487>,
#Fun<couch_db_updater.12.39068440>,
snappy},
{btree,<0.97.0>,
{16815,4,233},
#Fun<couch_db_updater.13.114276184>,
#Fun<couch_db_updater.14.2340873>,
#Fun<couch_btree.5.16030487>,
#Fun<couch_db_updater.15.23651859>,
snappy},
{btree,<0.97.0>,nil,
#Fun<couch_btree.3.22291614>,
#Fun<couch_btree.4.13941471>,
#Fun<couch_btree.5.16030487>,nil,snappy},
5,<<"_users">>,
"/usr/local/var/lib/couchdb/_users.couch",
[#Fun<couch_doc.8.29636382>],
[],nil,
{user_ctx,null,[<<"_admin">>],undefined},
nil,1000,
[before_header,after_header,on_file_open],
[{before_doc_update,
#Fun<couch_users_db.before_doc_update.2>},
{after_doc_read,
#Fun<couch_users_db.after_doc_read.2>},
sys_db,
{user_ctx,
{user_ctx,null,
[<<"_admin">>],
undefined}},
sys_db],
snappy,
#Fun<couch_users_db.before_doc_update.2>,
#Fun<couch_users_db.after_doc_read.2>},
<<"_design/xo_auth">>,<<"xrefbyid">>,nil],
[]},
{xo_auth,query_xref_view,3,
[{file,"xo_auth.erl"},{line,186}]},
{xo_auth,check_user_database,2,
[{file,"xo_auth.erl"},{line,48}]},
{fb_auth,handle_facebook_access_token,4,
[{file,"fb_auth.erl"},{line,36}]},
{couch_httpd,handle_request_int,5,[]},
{mochiweb_http,headers,5,[]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.