<s> from django . contrib . auth . backends import ModelBackend <EOL> from django . contrib . sites . models import Site <EOL> from socialregistration . contrib . facebook . models import FacebookProfile <EOL> class FacebookAuth ( ModelBackend ) : <EOL> supports_object_permissions = False <EOL> supports_anonymous_user = False <EOL> def authenticate ( self , uid = None ) : <EOL> try : <EOL> return FacebookProfile . objects . get ( <EOL> uid = uid , <EOL> site = Site . objects . get_current ( ) ) . user <EOL> except FacebookProfile . DoesNotExist : <EOL> return None </s>
