#NEWLINE# def _openid_args( self , callback_uri , ax_attrs = [ ] , oauth_scope = None ) : #NEWLINE# #INDENT# url = urlparse . urljoin ( self . request . full_url ( ) , callback_uri ) #NEWLINE# if hasattr ( self , 'openid_realm' ) : #NEWLINE# #INDENT# openid_realm = self . openid_realm #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# openid_realm = self . request . url_root #NEWLINE# #UNINDENT# args = { #NEWLINE# #INDENT# 'openid.ns' : 'http://specs.openid.net/auth/2.0' , #NEWLINE# 'openid.claimed_id' : 'http://specs.openid.net/auth/2.0/identifier_select' , #NEWLINE# 'openid.identity' : 'http://specs.openid.net/auth/2.0/identifier_select' , #NEWLINE# 'openid.return_to' : url , #NEWLINE# 'openid.realm' : openid_realm , #NEWLINE# 'openid.mode' : 'checkid_setup' , #NEWLINE# #UNINDENT# } #NEWLINE# if name : #NEWLINE# #INDENT# args . update ( { #NEWLINE# #INDENT# 'openid.ns.ax' : 'http://openid.net/srv/ax/1.0' , #NEWLINE# 'openid.ax.mode' : 'fetch_request' , #NEWLINE# #UNINDENT# } ) #NEWLINE# ax_attrs = set ( ax_attrs ) #NEWLINE# required = [ ] #NEWLINE# if ( 'name' in ax_attrs ) : #NEWLINE# #INDENT# ax_attrs -= set ( [ 'name' , 'firstname' , 'fullname' , 'lastname' ] ) #NEWLINE# required += [ 'firstname' , 'fullname' , 'lastname' ] #NEWLINE# args . update ( { #NEWLINE# #INDENT# 'openid.ax.type.firstname' : 'http://axschema.org/namePerson/first' , #NEWLINE# 'openid.ax.type.fullname' : 'http://axschema.org/namePerson' , #NEWLINE# 'openid.ax.type.lastname' : 'http://axschema.org/namePerson/last' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# known_attrs = { #NEWLINE# #INDENT# 'email' : 'http://axschema.org/contact/email' , #NEWLINE# 'language' : 'http://axschema.org/pref/language' , #NEWLINE# 'username' : 'http://axschema.org/namePerson/friendly' , #NEWLINE# #UNINDENT# } #NEWLINE# for name in ax_attrs : #NEWLINE# #INDENT# args [ ( 'openid.ax.type.' + name ) ] = known_attrs [ name ] #NEWLINE# required . append ( name ) #NEWLINE# #UNINDENT# args [ 'openid.ax.required' ] = ',' . join ( required ) #NEWLINE# #UNINDENT# if oauth_scope : #NEWLINE# #INDENT# args . update ( { #NEWLINE# #INDENT# 'openid.ns.oauth' : 'http://specs.openid.net/extensions/oauth/1.0' , #NEWLINE# 'openid.oauth.consumer' : self . request . host . split ( ':' ) [ 0 ] , #NEWLINE# 'openid.oauth.scope' : oauth_scope , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return args