@@ -193,7 +193,7 @@ def service_urls(self, binding=BINDING_HTTP_POST):
193193
194194    def  create_authn_request (self , destination , vorg = "" , scoping = None ,
195195                             binding = saml2 .BINDING_HTTP_POST ,
196-                              nameid_format = NAMEID_FORMAT_TRANSIENT ,
196+                              nameid_format = None ,
197197                             service_url_binding = None , message_id = 0 ,
198198                             consent = None , extensions = None , sign = None ,
199199                             allow_create = False , sign_prepare = False , ** kwargs ):
@@ -261,13 +261,19 @@ def create_authn_request(self, destination, vorg="", scoping=None,
261261            else :
262262                allow_create  =  "false" 
263263
264-             # Profile stuff, should be configurable 
265-             if  nameid_format  is  None :
266-                 name_id_policy  =  samlp .NameIDPolicy (
267-                     allow_create = allow_create , format = NAMEID_FORMAT_TRANSIENT )
268-             elif  nameid_format  ==  "" :
264+             if  nameid_format  ==  "" :
269265                name_id_policy  =  None 
270266            else :
267+                 if  nameid_format  is  None :
268+                     nameid_format  =  self .config .getattr ("name_id_format" , "sp" )
269+ 
270+                     if  nameid_format  is  None :
271+                         nameid_format  =  NAMEID_FORMAT_TRANSIENT 
272+                     elif  isinstance (nameid_format , list ):
273+                         # NameIDPolicy can only have one format specified 
274+                         nameid_format  =  nameid_format [0 ]
275+ 
276+ 
271277                name_id_policy  =  samlp .NameIDPolicy (allow_create = allow_create ,
272278                                                    format = nameid_format )
273279
0 commit comments