Exemple #1
0
 def update_farg(in_response_to, consumer_url, farg=None):
     if not farg:
         farg = add_path(
             {},
             ['assertion', 'subject', 'subject_confirmation', 'method',
              saml.SCM_BEARER])
         add_path(
             farg['assertion']['subject']['subject_confirmation'],
             ['subject_confirmation_data', 'in_response_to', in_response_to])
         add_path(
             farg['assertion']['subject']['subject_confirmation'],
             ['subject_confirmation_data', 'recipient', consumer_url])
     else:
         if not is_set(farg,
                       ['assertion', 'subject', 'subject_confirmation',
                        'method']):
             add_path(farg,
                      ['assertion', 'subject', 'subject_confirmation',
                       'method', saml.SCM_BEARER])
         if not is_set(farg,
                       ['assertion', 'subject', 'subject_confirmation',
                        'subject_confirmation_data', 'in_response_to']):
             add_path(farg,
                      ['assertion', 'subject', 'subject_confirmation',
                       'subject_confirmation_data', 'in_response_to',
                       in_response_to])
         if not is_set(farg, ['assertion', 'subject', 'subject_confirmation',
                              'subject_confirmation_data', 'recipient']):
             add_path(farg,
                      ['assertion', 'subject', 'subject_confirmation',
                       'subject_confirmation_data', 'recipient',
                       consumer_url])
     return farg
Exemple #2
0
 def update_farg(in_response_to, consumer_url, farg=None):
     if not farg:
         farg = add_path(
             {},
             ['assertion', 'subject', 'subject_confirmation', 'method',
              saml.SCM_BEARER])
         add_path(
             farg['assertion']['subject']['subject_confirmation'],
             ['subject_confirmation_data', 'in_response_to', in_response_to])
         add_path(
             farg['assertion']['subject']['subject_confirmation'],
             ['subject_confirmation_data', 'recipient', consumer_url])
     else:
         if not is_set(farg,
                       ['assertion', 'subject', 'subject_confirmation',
                        'method']):
             add_path(farg,
                      ['assertion', 'subject', 'subject_confirmation',
                       'method', saml.SCM_BEARER])
         if not is_set(farg,
                       ['assertion', 'subject', 'subject_confirmation',
                        'subject_confirmation_data', 'in_response_to']):
             add_path(farg,
                      ['assertion', 'subject', 'subject_confirmation',
                       'subject_confirmation_data', 'in_response_to',
                       in_response_to])
         if not is_set(farg, ['assertion', 'subject', 'subject_confirmation',
                              'subject_confirmation_data', 'recipient']):
             add_path(farg,
                      ['assertion', 'subject', 'subject_confirmation',
                       'subject_confirmation_data', 'recipient',
                       consumer_url])
     return farg
Exemple #3
0
 def update_farg(in_response_to, consumer_url, farg=None):
     if not farg:
         farg = add_path({}, ["assertion", "subject", "subject_confirmation", "method", saml.SCM_BEARER])
         add_path(
             farg["assertion"]["subject"]["subject_confirmation"],
             ["subject_confirmation_data", "in_response_to", in_response_to],
         )
         add_path(
             farg["assertion"]["subject"]["subject_confirmation"],
             ["subject_confirmation_data", "recipient", consumer_url],
         )
     else:
         if not is_set(farg, ["assertion", "subject", "subject_confirmation", "method"]):
             add_path(farg, ["assertion", "subject", "subject_confirmation", "method", saml.SCM_BEARER])
         if not is_set(
             farg, ["assertion", "subject", "subject_confirmation", "subject_confirmation_data", "in_response_to"]
         ):
             add_path(
                 farg,
                 [
                     "assertion",
                     "subject",
                     "subject_confirmation",
                     "subject_confirmation_data",
                     "in_response_to",
                     in_response_to,
                 ],
             )
         if not is_set(
             farg, ["assertion", "subject", "subject_confirmation", "subject_confirmation_data", "recipient"]
         ):
             add_path(
                 farg,
                 [
                     "assertion",
                     "subject",
                     "subject_confirmation",
                     "subject_confirmation_data",
                     "recipient",
                     consumer_url,
                 ],
             )
     return farg