def __init__(self, settings, force_authn=False, is_passive=False, set_nameid_policy=True, name_id_value_req=None):
self.__settings = settings<EOL>sp_data = self.__settings.get_sp_data()<EOL>idp_data = self.__settings.get_idp_data()<EOL>security = self.__settings.get_security_data()<EOL>uid = OneLogin_Saml2_Utils.generate_unique_id()<EOL>self.__id = uid<EOL>issue_instant = OneLogin_Saml2_Utils.parse_time_to_SAML(OneLogin_Saml2_Utils.now())<EOL>destination = idp_data['<STR_LIT>']['<STR_LIT:url>']<EOL>provider_name_str = '<STR_LIT>'<EOL>organization_data = settings.get_organization()<EOL>if isinstance(organization_data, dict) and organization_data:<EOL><INDENT>langs = organization_data.keys()<EOL>if '<STR_LIT>' in langs:<EOL><INDENT>lang = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>lang = langs[<NUM_LIT:0>]<EOL><DEDENT>if '<STR_LIT>' in organization_data[lang] and organization_data[lang]['<STR_LIT>'] is not None:<EOL><INDENT>provider_name_str = "<STR_LIT:\n>" + '<STR_LIT>' % organization_data[lang]['<STR_LIT>']<EOL><DEDENT><DEDENT>force_authn_str = '<STR_LIT>'<EOL>if force_authn is True:<EOL><INDENT>force_authn_str = "<STR_LIT:\n>" + '<STR_LIT>'<EOL><DEDENT>is_passive_str = '<STR_LIT>'<EOL>if is_passive is True:<EOL><INDENT>is_passive_str = "<STR_LIT:\n>" + '<STR_LIT>'<EOL><DEDENT>subject_str = '<STR_LIT>'<EOL>if name_id_value_req:<EOL><INDENT>subject_str = """<STR_LIT>""" % (sp_data['<STR_LIT>'], name_id_value_req)<EOL><DEDENT>nameid_policy_str = '<STR_LIT>'<EOL>if set_nameid_policy:<EOL><INDENT>name_id_policy_format = sp_data['<STR_LIT>']<EOL>if '<STR_LIT>' in security and security['<STR_LIT>']:<EOL><INDENT>name_id_policy_format = OneLogin_Saml2_Constants.NAMEID_ENCRYPTED<EOL><DEDENT>nameid_policy_str = """<STR_LIT>""" % name_id_policy_format<EOL><DEDENT>requested_authn_context_str = '<STR_LIT>'<EOL>if '<STR_LIT>' in security.keys() and security['<STR_LIT>'] is not False:<EOL><INDENT>authn_comparison = '<STR_LIT>'<EOL>if '<STR_LIT>' in security.keys():<EOL><INDENT>authn_comparison = security['<STR_LIT>']<EOL><DEDENT>if security['<STR_LIT>'] is True:<EOL><INDENT>requested_authn_context_str = "<STR_LIT:\n>" + """<STR_LIT>""" % authn_comparison<EOL><DEDENT>else:<EOL><INDENT>requested_authn_context_str = "<STR_LIT:\n>" + '<STR_LIT>' % authn_comparison<EOL>for authn_context in security['<STR_LIT>']:<EOL><INDENT>requested_authn_context_str += '<STR_LIT>' % authn_context<EOL><DEDENT>requested_authn_context_str += '<STR_LIT>'<EOL><DEDENT><DEDENT>attr_consuming_service_str = '<STR_LIT>'<EOL>if '<STR_LIT>' in sp_data and sp_data['<STR_LIT>']:<EOL><INDENT>attr_consuming_service_str = '<STR_LIT>'<EOL><DEDENT>request = """<STR_LIT>""" %{<EOL>'<STR_LIT:id>': uid,<EOL>'<STR_LIT>': provider_name_str,<EOL>'<STR_LIT>': force_authn_str,<EOL>'<STR_LIT>': is_passive_str,<EOL>'<STR_LIT>': issue_instant,<EOL>'<STR_LIT>': destination,<EOL>'<STR_LIT>': sp_data['<STR_LIT>']['<STR_LIT:url>'],<EOL>'<STR_LIT>': sp_data['<STR_LIT>'],<EOL>'<STR_LIT>': subject_str,<EOL>'<STR_LIT>': nameid_policy_str,<EOL>'<STR_LIT>': requested_authn_context_str,<EOL>'<STR_LIT>': attr_consuming_service_str<EOL>}<EOL>self.__authn_request = request<EOL>
Constructs the AuthnRequest object.

:param settings: OSetting data
:type settings: OneLogin_Saml2_Settings

:param force_authn: Optional argument. When true the AuthNRequest will set the ForceAuthn='true'.
:type force_authn: bool

:param is_passive: Optional argument. When true the AuthNRequest will set the Ispassive='true'.
:type is_passive: bool

:param set_nameid_policy: Optional argument. When true the AuthNRequest will set a nameIdPolicy element.
:type set_nameid_policy: bool

:param name_id_value_req: Optional argument. Indicates to the IdP the subject that should be authenticated
:type name_id_value_req: string