我不得不承認,我對這個主題相當陌生,特別是對erlang來說是新手。目前,我正在嘗試與各種身份驗證處理程序打交道 - 目標是在Facebook,Twitter等平臺上擁有一個可用的「委託身份驗證」。couchdb自定義身份驗證處理程序
- 據我瞭解,couchdb的oAuth實現正好與我需要的相反。您可以使用它爲沙發用戶創建令牌,但不接受twitter訪問令/祕密並將其映射到沙發用戶。
- 我在datacouch中發現了我需要的東西 - 使用nodejs對Twitter進行身份驗證,然後從私人沙發上獲取明文密碼,並將其與_session-API一起使用以創建沙發cookie。
現在我試圖避免存儲明文密碼。我聽說要使用proxy_authentification_handler,但似乎我太過於沒有經驗,或者甚至太愚蠢,無法使用它。我做了(據我瞭解)在couch_httpd_auth正確的條目
couch_httpd_auth auth_cache_size 50
authentication_db _users
authentication_redirect /_utils/session.html
require_valid_user false
proxy_use_secret false
secret xxxxxxxxxxxx
timeout 43200
x_auth_roles roles
x_auth_token token
x_auth_username uname
,並在部分的httpd
httpd allow_jsonp true
authentication_handlers {couch_httpd_auth, proxy_authentification_handler},{couch_httpd_auth, cookie_authentication_handler}, {couch_httpd_auth, default_authentication_handler}
bind_address 127.0.0.1
default_handler {couch_httpd_db, handle_request}
port 5984
secure_rewrites false
vhost_global_handlers _utils, _uuids, _session, _oauth, _users
由於在docs我設置proxy_use_secret假的評論也提到(爲第一步)允許沒有訪問令牌的身份驗證。
當我現在做http://localhost:5984/_utils/config.html?uname=user1&roles=user一個GET似乎不影響什麼...
有人曾經得到那個東西運行?我錯過了什麼嗎?還是有沒有機會實現一個自定義身份驗證處理程序而不編碼erlang?
非常感謝您的幫助