Using REST to Login user to Windows Live

泄露秘密 提交于 2019-12-08 04:19:51

问题


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.

I also have never used or coded something over REST.


回答1:


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.

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.

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




回答2:


Oauth is hard to get and hard to implement.

You should choose an off-the-shelf Oauth library they exists for most languages. (Then you do not have to worry about the details. OTOH: You should know how it works to know how to set up and fix if something goes wrong.)

http://oauth.net/code/



来源:https://stackoverflow.com/questions/9740216/using-rest-to-login-user-to-windows-live

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!