def setup_authentication(config):
 config.include('pyramid_multiauth')
 settings = config.get_settings()
 policies = aslist(settings['multiauth.policies'])
 if ('basicauth' in policies):
  config.include('kinto.core.authentication')
 def on_policy_selected(event):
  authn_type = event.policy_name.lower()
  event.request.authn_type = authn_type
  event.request.selected_userid = event.userid
  logger.bind(uid=event.userid, authn_type=authn_type)
 config.add_subscriber(on_policy_selected, MultiAuthPolicySelected)

def setup_authentication ( config ) : config . include ( 'pyramid_multiauth' ) settings = config . get_settings ( ) policies = aslist ( settings [ 'multiauth.policies' ] ) if ( 'basicauth' in policies ) : config . include ( 'kinto.core.authentication' ) def on_policy_selected ( event ) : authn_type = event . policy_name . lower ( ) event . request . authn_type = authn_type event . request . selected_userid = event . userid logger . bind ( uid = event . userid , authn_type = authn_type ) config . add_subscriber ( on_policy_selected , MultiAuthPolicySelected )
register non-default auth methods .