2009-11-17 6 views
4

pelle의 원래 추가 기능이 문제를 일으킨 것 같아서 githizka의 authlogic_openid 버전을 사용하여 authlogic에서 자동 등록 작업을했습니다. 내 옵션을 사용하는 authlogic auto_register 기능

using authlogic to auto create users bypassing explicit user registeration

이 같은 오픈 ID 공급자로부터 이메일을 검색하는 등의 authlogic 내 옵션을 무시 auto_register 기능을 사용할 때 하나는하지만 잘 작동

http://github.com/gaizka/authlogic_openid

은 ... 어떤 아이디어는 내가 무슨 일을하고 있어요 ?

Hhere의 예 : 당신이 로그인 대를 등록하면 당신은 차이를 볼 수 있습니다

http://big-glow-mama.heroku.com/

http://github.com/holden/authlogic_openid_selector_example/tree/with-facebook/

...

#user.rb 
class User < ActiveRecord::Base 
    acts_as_authentic do |c| 
    c.validate_login_field = false 
    # optional, but if a user registers by openid, he should at least share his email-address with the app 
    c.validate_email_field = false 
    # fetch email by ax 
    c.openid_required_fields = [:email,"http://axschema.org/contact/email"] 
    #c.required_fields = ["http://axschema.org/contact/email"] 
    # fetch email by sreg 
    #c.optional_fields = ["email"] 
    end 

    #private method to deal with emails goes here 

end 


#UserSession.rb 
class UserSession < Authlogic::Session::Base 
    auto_register 
    logout_on_timeout true 
end 

답변

4

이 사람은 그러나 잘 작동 auto_register 기능을 사용할 때 authlogic에 대한 내 옵션을 무시합니다. openid 공급자로부터 전자 메일을 가져 오는 중 ... 내가 뭘 잘못하고 있는지 아이디어가 있습니까?

자동 등록을 처리하는 코드는 authlogic_openid의 Session 모듈에 있습니다. 등록 (전자 양식 공급자 검색 등)을 처리하는 코드는 ActsAsAuthentic 모듈에 있습니다.

첫 번째는 UserSession 개체를 처리하며 후자는 User 개체를 처리합니다.

나는 두 가지 행동을 병합하기 위해 수행 할 수있는 작업을 살펴보기 위해 며칠 후에 살펴볼 것입니다.

+1

당신이 행동을 병합의 방법을 알아낼 수 있을까요? –