使用 REST 将用户登录到 Windows Live [英] Using REST to Login user to Windows Live

查看:29
本文介绍了使用 REST 将用户登录到 Windows Live的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在此处通读 Windows Live 开发人员文档.我看到他们正在使用类似这样的身份验证方法.

I was reading through the windows live developers doc here. In that I saw they are having an authentication method something like this.

GET https://oauth.live.com/authorize?client_id=CLIENT_ID&scope=SCOPES&     
response_type=RESPONSE_TYPE&redirect_uri=REDIRECT_URL

除了我在哪里提供用户的用户名和密码之外,我都明白了?我打算创建一个应用程序(我生命中的第一个)来学习工作.

I understood everything except for where do I give the username and password of the user? I am planning to create an app(first one in my life) to learn the working.

我也从未在 REST 上使用或编码过任何东西.

I also have never used or coded something over REST.

推荐答案

使用 OAuth 时,您的应用程序永远不会收到用户的用户名或密码.相反,用户登录到 Windows Live 服务器上的 Windows Live 并授权您的应用程序访问他们的信息.在他们授权您的应用程序后,您会代表用户从 Windows Live 收到一个访问令牌.然后,您可以通过 Live API 使用该访问令牌来检索用户信息.

When using OAuth, your application never receives the user's username or password. Rather, the user logs in to Windows Live on the Windows Live servers and authorizes your application for access to their information. After they have authorized your application, you receive an access token from Windows Live on behalf of the user. You then use that access token with the Live API to retrieve user information.

使用 REST 协议编写代码并不太复杂.根据我的经验,您只是使用 GET 或 POST 作为请求方法为 API 指定参数.将 OAuth 添加到您的请求中需要指定额外的参数.

Coding something using REST protocols isn't anything too terribly complicated. It has been my experience that you're just specifying parameters to the API using GET or POST as your request method. Adding OAuth on to your requests is a matter of specifying additional parameters.

您的任务是在这里学习两件事,因为您以前从未做过 REST 或 OAUTH.花时间看看两者.

You're task is to learn two things here since you've never done REST or OAUTH before. Spend time looking at both.

这篇关于使用 REST 将用户登录到 Windows Live的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆