[英]I am trying to get request token from Twitter api using c#, but getting 400 bad request error
[英]Trying to Login to the Web API using the “http://localhost:61961/Token”. Receiving 400 Bad Request Error
我是C#的新手。
我正在尝试使用URL- http:// localhost:61961 / Token登录到Web API Rest Service。 我收到一个错误Grant-type = invalid。 我读到Microsoft已为登录功能启用了单独的Web服务。 为了从我的应用程序中调用此服务,我将内容类型指定为application/x-www-form-urlencoded
并且grant_type=password&username=[my Username which is an email]&password=[my password]
。
我们可以给grant_type
任何值吗?
自定义登录功能比使用Microsoft登录功能更好吗?
感谢帮助。
当我使用正确的URL- http:// localhost:[端口号] / Token时,我能够打通Token服务。
我也以正确的格式给出了参数-grant_type = password&username = [username]&password = [password]
我认为您需要仔细检查令牌功能。 而不是发布特定问题。 另外,在grant_type中,您可以放置任何值。 从代码方面来看,它通过内置方法生成令牌,但是您可以为其创建自定义方法。 您必须在Google上进行一些搜索,然后才能找到令牌生成功能的确切工作方式。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.