简体   繁体   English

如何在授权字段中传递用户名和密码?

[英]How to pass username and password in authorization field?

In unrealscript, I'm attempting to connect to server using a TCPLink client I wrote. 在虚幻脚本中,我试图使用我编写的TCPLink客户端连接到服务器。 I can connect to the domain, but when I attempt to access a welcome message I receive a 401 error. 我可以连接到域,但是当我尝试访问欢迎消息时,出现401错误。 What am I doing wrong in my authorization field? 授权字段中我在做什么错?

Note: username and password are plain-text string variables filled in by the user 注意:用户名和密码是用户填写的纯文本字符串变量

SendText("GET /crud/welcome HTTP/1.0"$chr(13)$chr(10));
SendText("Host: "$TargetHost$chr(13)$chr(10));
SendText("Authorization: "$USERNAME$":"$PASSWORD$chr(13)$chr(10));
SendText("Connection: Close"$chr(13)$chr(10));
SendText(chr(13)$chr(10));

您可能需要阅读RFC 2617。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用户如何通过用户名和密码传递API密钥? - How users pass API key with their username and password? 如何从用户名和密码计算基本授权标头 - How to compute Basic Authorization header from username and password 如何从浏览器中删除“授权:基本用户名:密码”标题 - How to remove 'Authorization: Basic username:password' header from browser REST授权:授权标头与JSON正文中的用户名/密码 - REST Authorization: Username/Password in Authorization Header vs JSON body 如何在图像 URL HTML 中传递用户名和密码? - How to pass username and password in image URL HTML.? 在HTTP Basic Auth的URL中传递用户名和密码 - Pass username and password in URL for HTTP Basic Auth 如何在Android和Rails / Apache之间安全地传递用户名/密码和身份验证令牌 - How to securely pass username/password and auth tokens between Android and Rails/Apache 当客户端包含用户名和密码时,如何处理HTTP响应中的位置字段? - How should a client handle Location field in an HTTP response when it includes a username & password? 是否需要在任何具有基本身份验证的请求中传递username:password组合? - Does it needs to pass username:password combination in any request with basic auth? 哪个更好,在HTTP头或HTTP Body中传递用户名/密码作为参数? - Which is better, pass username/password as parameters in HTTP header or HTTP Body?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM