HTTP Basic Authentication with HTTPService Objects in Adobe Flex/AIR

前端 未结 8 1422
梦谈多话
梦谈多话 2020-12-04 14:52

I\'m trying to request a HTTP resource that requires basic authorization headers from within an Adobe AIR application. I\'ve tried manually adding the headers to the request

相关标签:
8条回答
  • 2020-12-04 15:25

    Finally received some attention from Adobe and got an answer on this. The problem with long HTTP Authentication headers is that, by default, the Base64Encoder class will inject newline characters every 72 characters. Obviously that causes a chunk of the base-64 encoded string to be interpreted as a new header attribute, which causes the error.

    You can fix this by setting (in the above example) encoder.insertNewLines = false; The default setting is true.

    I've fixed the above code to work for arbitrarily long Authentication strings.

    0 讨论(0)
  • 2020-12-04 15:25

    Try using setCredentials rather than setRemoteCredentials and failing that, using Fiddler/Charles to find out what headers are being sent with the request.

    0 讨论(0)
提交回复
热议问题