#NEWLINE# def processTrustResult( request ) : #NEWLINE# #INDENT# '\n    Handle the result of a trust decision and respond to the RP\n    accordingly.\n    ' #NEWLINE# openid_request = getRequest ( request ) #NEWLINE# response_identity = getViewURL ( request , idPage ) #NEWLINE# allowed = ( 'allow' in request . POST ) #NEWLINE# openid_response = openid_request . answer ( allowed , identity = response_identity ) #NEWLINE# if allowed : #NEWLINE# #INDENT# sreg_data = { #NEWLINE# #INDENT# 'fullname' : 'Example User' , #NEWLINE# 'nickname' : 'example' , #NEWLINE# 'dob' : '1970-01-01' , #NEWLINE# 'email' : 'invalid@example.com' , #NEWLINE# 'gender' : 'F' , #NEWLINE# 'postcode' : '12345' , #NEWLINE# 'country' : 'ES' , #NEWLINE# 'language' : 'eu' , #NEWLINE# 'timezone' : 'America/New_York' , #NEWLINE# #UNINDENT# } #NEWLINE# sreg_req = sreg . SRegRequest . fromOpenIDRequest ( openid_request ) #NEWLINE# sreg_resp = sreg . SRegResponse . extractResponse ( sreg_req , sreg_data ) #NEWLINE# openid_response . addExtension ( sreg_resp ) #NEWLINE# pape_response = pape . Response ( ) #NEWLINE# pape_response . setAuthLevel ( pape . LEVELS_NIST , 0 ) #NEWLINE# openid_response . addExtension ( pape_response ) #NEWLINE# #UNINDENT# return displayResponse ( request , openid_response )