Skip to content

Unsupported browser error #230

Closed
Closed

Description

@sti0

Hi there,

we're using pyodata for quite a while and everything runs fine until yesterday. We can't connect to our odata service anymore.

We're receiving the following error:

pyodata.exceptions.HttpError: Metadata request failed, status code: 401, body:
b'<html data-sap-ls-system-userAgent="0.00" data-sap-ls-system-device="" data-sap-ls-system-platform="" data-sap-ls-system-isRtl="false" data-sap-ls-system-useAnimation="false" lang="de"><head><meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no"><link rel="icon" type="image/x-icon" href="/sap/public/bc/ur/Login/assets/favicon.ico"><title>Anmeldung</title><link rel="stylesheet" type="text/css" id="SL__PAGE-stylesheet" href="/sap/public/bc/ur/nw5/themes/sap_tradeshow_plus/ls/ls_sf3.css?202112171130" t="sap_tradeshow_plus" p="ls" d="" data-sap-ls-css="true"><style type="text/css">#lifestyle {\tfloat:left;\tborder:0;\tmargin:0;\tpadding:0;}#SLB_contentcell {  width:100%;}#SLB_infobox {  overflow-x: auto;  width: 290px;}#boxcontent {\tmargin-left:335px; /* width of the lifestyle photo + 40 pixels for gutter space */\tpadding:0;}#dynamiccontent {}#dynamiccontent #titlegraphic {\tpadding:0;\tmargin:0;}#dynamiccontent p {\tmargin-top:0;}#copyright {\tmargin-top:20px;\theight:27px;\tposition:relative;}#copyright div {\tfont: normal 11px Arial, Helvetica, sans-serif;\tfloat:left;\tposition:absolute;\tbottom:0;\tleft:0;}#copyrighttxt { color: #000;}#copyrighttxt-hcb { color: #fff;}#copyright img {\tfloat: right;}#container {\twidth: 100%;\tmargin-top: 50px;\tpadding:0;}</style><script type="text/javascript" src="/sap/public/bc/ur/nw7/js/domainrelax.js?DF907E2B7B23"></script><script type="text/javascript">ur_relax();</script><script type="text/javascript" src="/sap/public/bc/ur/nw7/js/lightspeed.js?DF907E2B7B23"></script></head><body tabindex="-1" ti="-1" supportedthemes="sap_corbu" class="urBdyStd&#x20;urBdyStdNoMrg&#x20;lsPage&#x20;lsPage--mouse"><div class="urCanvasBgImage&#x20;lsControl--invisible"></div><table border="0" cellspacing="0" cellpadding="0" class="lsPage--wide&#x20;lsPage--verticalsizing--fill"><tr><td class="lsPage--verticalsizing--fill"><div id="SL__PAGE" ct="PAGE" lsdata="{}" class="lsPage--wide&#x20;lsPage--verticalsizing--fill"><span id="SL__FLOWLAYOUT1" ct="FL" lsdata="{}" class="lsFlowLayout&#x20;lsControl--wrapping&#x20;"><span class="lsFlowLayoutItem&#x20;lsFlowLayoutItem--wrapping" id="SL__FLOWLAYOUT1_1"><form ct="FOR" id="SL__FORM" name="loginForm" method="POST" action="&#x2f;sap&#x2f;c4c&#x2f;odata&#x2f;v1&#x2f;c4codataapi&#x2f;&#x24;metadata" class="lsForm" lsdata="{0:true}" lsevents="{Submit:[{\'ClientAction\':\'submit\',\'ActionUrl\':\'\',\'ResponseData\':\'full\',\'PrepareScript\':\'\'},{}]}"><input id="FOCUS_ID" ct="I" lsdata="{0:\'sap&#x5c;x2dalias\'}" type="hidden" name="FOCUS_ID" value="sap-alias">\r\n<input type="hidden" name="sap-system-login-oninputprocessing" value="">\r\n<input type="hidden" name="sap-urlscheme" value="">\r\n<input type="hidden" name="sap-system-login" value="onLogin">\r\n<input type="hidden" name="sap-system-login-basic_auth" value="">\r\n<input type="hidden" name="sap-client" value="034">\r\n<input type="hidden" name="sap-language" value="DE">\r\n<input type="hidden" name="sap-accessibility" value="">\r\n<input type="hidden" name="sap-login-XSRF" value="XMkfqnL1RFMS7JzIp2KI_BBxbu6EEJCij-eGjbiIBEk&#x3d;">\r\n<input type="hidden" name="sap-system-login-cookie_disabled" value=""><noscript><iframe style=position:absolute;top:0;left:0;width:100%;height:100% src=?sap-system-login-oninputprocessing=onNoScript></noscript><div id="SL__LAYOUT_CONTAINER" ct="CO" lsdata="{}" class=""><table id="container" style="width:100%"><tr><td style="width:50%">&nbsp;</td><td><table dir="ltr" width="709" border="0" cellpadding="0" cellspacing="0">  <tr>   <td><img src="/sap/public/bc/ur/Login/assets/LogIn_frame_topleft.png" width="29" height="32"></td>   <td background="/sap/public/bc/ur/Login/assets/LogIn_frame_stretch_top.png"></td>   <td><img src="/sap/public/bc/ur/Login/assets/LogIn_frame_topright.png" width="27" height="32"></td>  </tr>  <tr>   <td background="/sap/public/bc/ur/Login/assets/LogIn_frame_stretch_left.png"></td>   <td class="urCellBgPlain" id="SLB_contentcell">   <!-- start login box content -->   <table width="100%" cellspacing="0" cellpadding="0"><tr><td rowspan="2" valign="top" width="290" style="padding-right:40px"><div id="SLB_infobox">     <img src="/sap/public/bc/ur/Login/assets/NetWeaver_Default_Picture.jpg" width="290" height="360">   </div></td><td height="100%" width="100%" dir="ltr">       <div id="titlegraphic"><img src="/sap/public/bc/ur/Login/assets/SAPNetWeaverLoginTitle_wo_Subtitle.jpg" width="325" height="87"></div>       <div id="dynamiccontent"><div id="SL__LAYOUT" ct="SL" lsdata="{}"><div id="SL__LAYOUT_1" class="urLayoutDefault2&#x20;lsContainerCell--wrap"><div id="-r" class="lsMatrixLayout-root&#x20;lsControl--fullwidth"><table cellspacing="0" cellpadding="0" ct="ML" lsdata="{2:\'100&#x5c;x25\'}" class="urMatrixLayout&#x20;lsControl--fullwidth" border="0"><tbody class="urLinStd"><tr><td ct="MLC" lsdata="{}" id="" valign="middle" class="lsContainerCell&#x20;&#x20;urLayoutDefault&#x20;lsContainerCell--wrap"><div tabindex="0" ti="0" title="Meldungsnummer&#x20;SWDP_UR_NW7001" class="lsMessageBar&#x20;urMsgBarErrBtm&#x20;lsMessageBar--Bottom&#x20;lsMessageBar--TypeError" id="m1" ct="MB" lsdata="{0:\'Sie&#x5c;x20rufen&#x5c;x20diese&#x5c;x20Website&#x5c;x20mit&#x5c;x20einem&#x5c;x20Browser&#x5c;x20auf,&#x5c;x20der&#x5c;x20nicht&#x5c;x20unterst&#x5c;xfctzt&#x5c;x20ist.\',1:\'ERROR\',5:\'Meldungsnummer&#x5c;x20SWDP_UR_NW7001\'}"><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td valign="top" id="m1-icon" class="lsMsgBarIcn&#x20;lsMsgBarIconError"><img alt="" src="/sap/public/bc/ur/nw5/1x1.gif" id="m1-img" class="lsMsgBarImgDspl&#x20;urMsgBarImgError"></td><td class="lsMsgBarTxt&#x20;urTxtStd&#x20;urTxtColor"><span id="m1-txt">Sie&#x20;rufen&#x20;diese&#x20;Website&#x20;mit&#x20;einem&#x20;Browser&#x20;auf,&#x20;der&#x20;nicht&#x20;unterst&#xfc;tzt&#x20;ist.</span></td></tr></table></div></td></tr></table></div></div><div id="SL__LAYOUT_2" class="urLayoutDefault2&#x20;lsContainerCell--wrap"><div id="SL__DIVIDER1" ct="HD" lsdata="{}" class="urHSpcSml&#x20;urNoUserSelect&#x20;"><img alt="" src="/sap/public/bc/ur/nw5/1x1.gif" class="urHDImg"></div></div><div id="SL__LAYOUT_3" class="urLayoutDefault2&#x20;lsContainerCell--wrap"><DIV id="SL1" ct="SC" lsdata="{0:\'NONE\',3:false,4:\'LOGON_BUTTON\'}" title="" class="lsHTMLContainer&#x20;lsScrollContainer--nonescrolling" tabindex="0" ti="0"><table title="" cellspacing="0" cellpadding="0" id="g1" class="urFontStd&#x20;" ct="GL" lsdata="{}" border="0"><tbody><tr><td id="g1-row-0-top"></td></tr><tr id="g1-row-0"><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"><span id="l3-r" class="lsLabel--root"><label ct="L" lsdata="{1:\'sap&#x5c;x2dalias\',3:\'Benutzer\',5:false}" id="l3" f="sap-alias" class="lsControl--valign&#x20;lsLabel&#x20;lsTextNoWrapping&#x20;lsControl--noWrapping&#x20;lsLStandard&#x20;urLDsbl&#x20;urLabel--nowrap">Benutzer:</label></span></td><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"><span id="dummy_sap_user-r" class="lsField&#x20;lsField--empty&#x20;lsField--standalone&#x20;lsField--explicitwidth&#x20;lsField--hasellipsis&#x20;lsField--disabled&#x20;lsField--508&#x20;lsField--f4&#x20;lsField--interactiontarget"><input id="dummy_sap_user" ct="I" lsdata="{3:\'20ex\'}" type="text" size="12" maxlength="40" tabindex="0" ti="0" class="lsField__input" readonly autocomplete="off" autocorrect="off" name="dummy_sap_user"><style id="dummy_sap_user-style">#dummy_sap_user{width:20ex;}</style></span></td></tr><tr><td id="g1-row-1-top"></td></tr><tr id="g1-row-1"><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"><span id="l4-r" class="lsLabel--root"><label ct="L" lsdata="{1:\'sap&#x5c;x2dpassword\',3:\'Kennwort\',5:false}" id="l4" f="sap-password" class="lsControl--valign&#x20;lsLabel&#x20;lsTextNoWrapping&#x20;lsControl--noWrapping&#x20;lsLStandard&#x20;urLDsbl&#x20;urLabel--nowrap">Kennwort:</label></span></td><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"><span id="dummy_sap_password-r" class="lsField&#x20;lsField--empty&#x20;lsField--standalone&#x20;lsField--explicitwidth&#x20;lsField--hasellipsis&#x20;lsField--disabled&#x20;lsField--508&#x20;lsField--f4&#x20;lsField--interactiontarget"><input id="dummy_sap_password" ct="I" lsdata="{3:\'20ex\'}" type="text" size="12" maxlength="40" tabindex="0" ti="0" class="lsField__input" readonly autocomplete="off" autocorrect="off" name="dummy_sap_password"><style id="dummy_sap_password-style">#dummy_sap_password{width:20ex;}</style></span></td></tr><tr><td id="g1-row-2-top"></td></tr><tr id="g1-row-2"><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"></td><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"><a ondragstart="var&#x20;e&#x3d;window.event&#x3b;e.cancelBubble&#x3d;true&#x3b;e.returnValue&#x3d;false&#x3b;return&#x20;false&#x3b;" id="LOGON_BUTTON" ct="B" lsdata="{0:\'Anmelden\',2:\'EMPHASIZED\',5:false}" lsevents="{Press:[{ResponseData:\'delta\'},{}]}" tabindex="0" ti="0" class="lsButton&#x20;lsButton--base&#x20;urNoUserSelect&#x20;urBtnRadius&#x20;urBtnEmphDsbl&#x20;lsButton--disabled" style="text-align:center;overflow:visible;"><span id="LOGON_BUTTON-txt" class="urNoUserSelect&#x20;urBtnCntDsbl"><span class="lsButton__text&#x20;urBtnCntTxt">Anmelden</span></span></a></td></tr><style id="g1-style">#g1-row-0-top{height:5px;}#{width:125;padding-right:10px;}#g1-row-1-top{height:5px;}#{width:125;padding-right:10px;}#g1-row-2-top{height:5px;}</style></table><span tabindex="0" ti="0" id="SL1-end"></span></DIV></div><div id="SL__LAYOUT_4" class="urLayoutDefault2&#x20;lsContainerCell--wrap"><div id="SL__DIVIDER2" ct="HD" lsdata="{}" class="urHSpcSml&#x20;urNoUserSelect&#x20;"><img alt="" src="/sap/public/bc/ur/nw5/1x1.gif" class="urHDImg"></div></div><div id="SL__LAYOUT_5" class="urLayoutDefault2&#x20;lsContainerCell--wrap"><table title="" cellspacing="0" cellpadding="0" id="g4" class="urFontStd&#x20;" ct="GL" lsdata="{}" border="0"><tbody><tr id="g4-row-0"><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"><table title="" cellspacing="0" cellpadding="0" id="g5" class="urFontStd&#x20;" ct="GL" lsdata="{}" border="0"><tbody><tr id="g5-row-0"><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--nowrap"><a class="lsControl--valign&#x20;urLnkDsbl&#x20;urLnkRepDsbl&#x20;lsLink--text" id="CHANGE_PASSWORD_LINK" ct="LN" lsdata="{1:\'Kennwort&#x5c;x20&#x5c;xe4ndern\',3:false}" lsevents="{Activate:[{ResponseData:\'delta\'},{}]}" tabindex="0" ti="0" title="" ondragstart="var&#x20;e&#x3d;window.event&#x3b;e.cancelBubble&#x3d;true&#x3b;e.returnValue&#x3d;false&#x3b;return&#x20;false&#x3b;"><span id="CHANGE_PASSWORD_LINK-text" class="lsLink__text&#x20;lsLink__text--disabled&#x20;lsLink--508">Kennwort&#x20;&#xe4;ndern</span></a></td></tr><style id="g5-style">#{padding-right:10px;}</style></table></td></tr><tr id="g4-row-1"><td ct="GLC" lsdata="{}" id="" class="lsContainerCell&#x20;urLayoutDefault--grid&#x20;lsContainerCell--wrap"><table title="" cellspacing="0" cellpadding="0" id="g6" class="urFontStd&#x20;" ct="GL" lsdata="{}" border="0"><tbody><tr><td></td></tr></table></td></tr></table></div></div>       </div>   </td></tr><tr><td>       <div id="copyright">         <div id="copyrighttxt">Copyright &copy; 2022 SAP SE. All rights reserved.</div>         <img src="/sap/public/bc/ur/Login/assets/sap_logo.png" width="55" height="27"></div>      </div>   </td></tr></table>     <!-- end login box content -->     </td>   <td background="/sap/public/bc/ur/Login/assets/LogIn_frame_stretch_right.png"></td>  </tr>  <tr>   <td><img src="/sap/public/bc/ur/Login/assets/LogIn_frame_bottomleft.png" width="29" height="32"></td>   <td align="center" background="/sap/public/bc/ur/Login/assets/LogIn_frame_stretch_bottom.png"><span class="clip"><img src="/sap/public/bc/ur/Login/assets/frame_clip.png" width="298" height="32"></span></td>   <td><img src="/sap/public/bc/ur/Login/assets/LogIn_frame_bottomright.png" width="27" height="32"></td>  </tr></table></td><td style="width:50%">&nbsp;</td></tr></table><span id="SL__LAYOUT_CONTAINER-TsEnd"></span></div><div id="ur-loading" class="lsLoadARoot" ct="LA" lsdata="{}" style="position:absolute;left:0px;top:-5000px;display:none;"><div id="ur-loading-box" class="urLoadA&#x20;lsLoadABlockLayer"><div id="ur-loading-itm1" class="lsLoadAItem&#x20;lsLoadAItem1Display&#x20;lsLoadAItem1Delay"></div><div id="ur-loading-itm2" class="lsLoadAItem&#x20;lsLoadAItem2Display&#x20;lsLoadAItem2Delay&#x20;lsLoadImg"></div><div id="ur-loading-itm3" class="lsLoadAItem&#x20;lsLoadAItem3Display"></div></div></div></form><wbr class="lsFlowLayout--cell-wrapping-element"></span><span class="lsFlowLayoutItem&#x20;lsFlowLayoutItem--wrapping" id="SL__FLOWLAYOUT1_2"></span></span><div id="SL__PAGE-asso"></div></div></td></tr></table><span id="UCF_InitializeIDs" style="display:none">["SL__FORM", "SL__PAGE"]</span><span class="lsControl--invisible" ct="SY" id="UCF_System" lsdata="{0:true,2:\'\',3:\'de\',4:1,8:\'&#x5c;x2fsap&#x5c;x2fpublic&#x5c;x2fbc&#x5c;x2fur&#x5c;x2fnw5&#x5c;x2fthemes&#x5c;x2fsap_tradeshow_plus\',9:\'&#x5c;x2fsap&#x5c;x2fpublic&#x5c;x2fbc&#x5c;x2fur&#x5c;x2fnw5&#x5c;x2fthemes&#x5c;x2fsap_tradeshow_plus&#x5c;x2fls&#x5c;x2fls_sf3.css&#x5c;x3f202112171130\',10:\'&#x5c;x2fsap&#x5c;x2fpublic&#x5c;x2fbc&#x5c;x2fur&#x5c;x2fnw7\',11:\'&#x5c;x2fsap&#x5c;x2fpublic&#x5c;x2fbc&#x5c;x2fur&#x5c;x2fnw5&#x5c;x2f1x1.gif\',13:false,15:true,16:\'\',17:\'DF907E2B7B23\',18:\'\',22:\'\',25:\'sap_tradeshow_plus\'}"></span><script type="text/javascript">\r\nfunction icf_system_cookiesDisabled(){\r\nvar cookie_field = document.getElementsByName("sap-system-login-cookie_disabled")[0];\r\nvar cookie_old = cookie_field.value;\r\ndocument.cookie = "Active=true;EXPIRES=Monday, 31-Dec-2023 23:59:59 GMT;";\r\nif (document.cookie.indexOf("Active=true") >= 0) {\r\ndocument.cookie = "Active=true;EXPIRES=Monday, 31-Dec-2023 23:59:59 GMT;";\r\ncookie_field.value = "";\r\n}\r\nelse{\r\ncookie_field.value = "X";\r\n}\r\nreturn cookie_field.value != cookie_old;\r\n}\r\nfunction icf_system_cookieCheck(){\r\nif (! document.getElementsByName("sap-system-login-basic_auth")[0].value ) {\r\nif (icf_system_cookiesDisabled())\r\ndocument.loginForm.submit();\r\n}\r\n}\r\nfunction setFocusSafe(name){\r\n  var el = document.getElementsByName(name)[0];\r\n  if (!el.disabled) el.focus();\r\n}\r\nvar wait = 4000;\r\nfunction selfSubmit(){\r\n  sapSL_Submit( "" );\r\n}\r\nfunction checkKey2Login(evt){\r\nvar keyCode = document.layers ? evt.which : document.all ? evt.keyCode : evt.keyCode;\r\nif(keyCode == 13) \r\ncallSubmitLogin(\'onLogin\');\r\n}\r\nfunction checkKey2Changepw(evt){\r\nvar keyCode = document.layers ? evt.which : document.all ? evt.keyCode : evt.keyCode;\r\nif(keyCode == 13) \r\ncallSubmitChangepw(\'onDoChangePwd\');\r\n}\r\nfunction callSubmitSysmsg(value){\r\n    document.getElementsByName("sap-system-login-oninputprocessing")[0].value = value;\r\n    document.systemMessageForm.submit();\r\n}\r\nfunction callSubmitSessionQuery(value){\r\n    document.getElementsByName("sap-system-login-oninputprocessing")[0].value = value;\r\n    document.sessionQuery.submit();\r\n}\r\nfunction callSubmitChangepw(value){\r\nif(value == "onDoDeletePwd"){\r\ndocument.getElementsByName("sap-system-login-oninputprocessing")[0].value = value;\r\ndocument.changePWForm.submit();\r\nreturn;\r\n}\r\ndocument.getElementsByName("sap-system-login-oninputprocessing")[0].value = value;\r\nvar sap_pwd = document.getElementsByName("sap-password")[0];\r\nif (sap_pwd) sap_pwd.value = document.getElementsByName("sap-system-login-password")[0].value;\r\ndocument.changePWForm.submit();\r\n}\r\nfunction callSubmitLogin(value){\r\nif(document.getElementsByName("sap-alias")[0].value.length==0){\r\nalert("Geben\\x20Sie\\x20Ihren\\x20Benutzer\\x20an");\r\ndocument.getElementsByName("sap-alias")[0].focus(); return;\r\n}\r\nif(document.getElementsByName("sap-password")[0].value.length==0){\r\nalert("Geben\\x20Sie\\x20Ihr\\x20Kennwort\\x20an");\r\ndocument.getElementsByName("sap-password")[0].focus();\r\nreturn;\r\n}\r\ndocument.getElementsByName("sap-system-login-oninputprocessing")[0].value=value;\r\nsapSL_Protect();\r\ndocument.loginForm.submit();\r\n}\r\nfunction sapSL_Submit(event) {\r\ndocument.getElementsByName("sap-system-login-oninputprocessing")[0].value=event;\r\nsapSL_Protect();\r\ndocument.loginForm.submit();\r\nreturn false;\r\n}\r\n\r\nfunction sapSL_LoginButton_onClick(obj,event) {\r\n  if (!sapUrMapi_Button_checkClick(obj.id,event)) return true;\r\n  return sapSL_LoginSubmit();\r\n}\r\n\r\nfunction sapSL_MessageBoxButton_onClick(obj,event) {\r\n  if (!sapUrMapi_Button_checkClick(obj.id,event)) return true;\r\n  return sapSL_Submit("");\r\n}\r\n\r\nfunction sapSL_Protect() {\r\n    var inputs = document.getElementsByTagName(\'INPUT\');\r\n    for ( var i=0; i<inputs.length; i++) {\r\n        if (inputs[i].getAttribute(\'ct\')==\'InputField\') {\r\n            sapUrMapi_InputField_setDisabled( inputs[i].id );\r\n        }\r\n    }\r\n    \r\n    var buttons = document.getElementsByTagName(\'A\');\r\n    for ( var i=0; i<buttons.length; i++) {\r\n        if (buttons[i].getAttribute(\'ct\')==\'Button\') {\r\n            sapUrMapi_Button_setDisabled( buttons[i].id );\r\n        }\r\n    }\r\n}\r\nfunction SL_SystemLogin() {\r\n  this.handleEvent = SL_SystemLogin_handleEvent;\r\n}\r\nfunction SL_SystemLogin_handleEvent(semanticEvent) {\r\n  var eventStr = semanticEvent.mGetParameters().Id + ";" + semanticEvent.sGetName();\r\n  switch (eventStr) {\r\n    case "LOGON_BUTTON;Press":\r\n      callSubmitLogin(\'onLogin\');\r\n      return false;\r\n    case "CHANGE_PASSWORD_BUTTON;Press":\r\n      callSubmitChangepw(\'onDoChangePwd\');\r\n      return false;\r\n    case "CANCEL_PASSWORD_BUTTON;Press":\r\n      callSubmitChangepw(\'onCancelPwd\');\r\n      return false;\r\n    case "DEACTIVE_PASSWORD_BUTTON;Press":\r\n      callSubmitChangepw(\'onDoDeletePwd\');\r\n      return false;\r\n    case "MESSAGE_BOX_CONTINUE_BUTTON;Press":\r\n      sapSL_Submit("");\r\n      return false;\r\n    case "SESSION_QUERY_CONTINUE_BUTTON;Press":\r\n      callSubmitSessionQuery(\'onSessionQuery\');\r\n      return false;\r\n    case "SYSTEM_MESSAGE_CONTINUE_BUTTON;Press":\r\n      callSubmitSysmsg(\'onContinueSysMsg\');\r\n      return false;\r\n    case "CHANGE_PASSWORD_LINK;Activate":\r\n      callSubmitLogin(\'onChangePwd\');\r\n      return true;\r\n    case "sap-accessibility-cb;Change":\r\n      document.getElementById("sap-accessibility").value = semanticEvent.mGetParameters().Checked ? "X" : "";\r\n      return false;\r\n    case "sap-certificatecheck-cb;Change":\r\n      document.getElementById("sap-certificatecheck").value = semanticEvent.mGetParameters().Checked ? "X" : "";\r\n      return false;\r\n    case "delete-session-cb;Change":\r\n      document.getElementById("delete_session").value = semanticEvent.mGetParameters().Checked ? "X" : "";\r\n      return false;\r\n    case "sap-language-dropdown;Select":\r\n      document.getElementById("sap-language").value = semanticEvent.mGetParameters().Key;\r\n      return false;\r\n    default:\r\n  }\r\n}\r\nfunction SL_SystemLogin_destroy() {\r\n  UCF_ls.destroy();\r\n}\r\nfunction SL_SystemLogin() {\r\n  this.handleEvent = SL_SystemLogin_handleEvent;\r\n  UCF_ls = new UCF_LS(document.body);\r\n  UCF_DomUtil.attachEvent(window, \'unload\', SL_SystemLogin_destroy);\r\n  UCF_ls.setSemanticEventHandler(this,"handleEvent");\r\n  var focusId = document.getElementById("FOCUS_ID").value;\r\n  if (focusId) window.UCF_ls.focusElement( focusId );\r\n}\r\nfunction SL_SystemLogin_init() {\r\n  SL_systemLogin = new SL_SystemLogin();\r\n}\r\nwindow.onload = SL_SystemLogin_init;\r\n\r\nfunction sapSL_Protect() {\r\n}</script><div id="SL__PAGE-static"></div><div class="lsControl--invisible" id="SL__PAGE-animations"></div><style media="print" type="text/css">.lsnoprint{display:none}.lsprinthighlight{border:none 0px!important;padding:0!important;margin:0!important}.urBdyStd{background-color:#FFF}.urSTTHResize {filter: ;}</style></body></html>'

More detailed:
<span id="m1-txt">Sie&#x20;rufen&#x20;diese&#x20;Website&#x20;mit&#x20;einem&#x20;Browser&#x20;auf,&#x20;der&#x20;nicht&#x20;unterst&#xfc;tzt&#x20;ist.</span>
=> You opend this website with an unsupported browser.

If I try to access metadata with Postman it still works.
I did some testing and figured out, that if I set a Cookie header (used the one from Postman) it works fine:

import requests
import pyodata

session = requests.Session()
SERVICE_URL = "https://our/service/url/"
session.auth = ("<<USER>>", "<<PASS>>")
headers = {
  'Cookie': 'SAP_SESSIONID_LQI_123=o434asADEX2XjtkglNosVljT1ekvORHtnAwCwf833UY%3d; sap-usercontext=sap-client=123'
}
session.headers = headers
client = pyodata.Client(SERVICE_URL, session)

Only setting the sap client like descripted here, doesn't work.

Is it the right way to set a cookie upfront to get odata access?
How to generate the cookie for accessing the api?

Thanks in advance

Activity

  1. sti0 commented on Sep 9, 2022

    @sti0
    ContributorAuthor

    nervermind...issue is related to odata account problems

  2. phanak-sap commented on Sep 9, 2022

    @phanak-sap
    Contributor

    Well, that was my initial guess, that it will be somehow relevant to the service itself.

    Anyway, as postmortem - for networking issues you are not on pyodata, but on your networking library layer, the "requests". So go to the requests library documentation for setting up cookies on session object, google or stackoverflow, etc.

    Also, it may be useful to see the full log of generated http traffic, including HTTP headers, for that use following snippet (basically after the import statements in your example code). Took some time for me to find how to enable it for requests library, so here it is:

    from http.client import HTTPConnection
    HTTPConnection.debuglevel = 1
    import logging
    logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
    logging.getLogger().setLevel(logging.DEBUG)
    requests_log = logging.getLogger("requests.packages.urllib3")
    requests_log.setLevel(logging.DEBUG)
    requests_log.propagate = True
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions