Callback URL in Skydrive API to localhost

南楼画角 提交于 2019-12-14 04:23:16

问题


I am trying to implement SkyDrive API into my Asp.net mvc3 application.I tried to create app in Microsoft using this tutorial for implementing user authentication , but I am facing a problem in Callback Url, because Microsoft forces me to add a real domain and I want to use my localhost in order to develop it right now.


回答1:


Alternatively you could add a fake domain to your

  • /etc/hosts (Linux)
  • C:\Windows\System32\drivers\etc\hosts (windows)

file. Just add the following lines:

127.0.0.1   www.yourfakedomain.de

After adding that line you can choose in Microsoft OneDrive App-Center something like

http://www.yourfakedomain.de/blabla.php

as your redirect uri.

Since your operating system thinks that domain belongs to localhost you will be able to get your authentication code just normally at your local test domain ;-)




回答2:


How would SkyDrive call code on your local machine?

One way to do it is to first mock SkyDrive in your application -- that is, you don't call the real SkyDrive, just a service that you have running locally that acts as if it is SkyDrive. You can use that to develop and debug your application to some extent.

Then you can deploy your application to a test server on the Internet, so that SkyDrive can do the callback, and you can test it there and make the necessary modifications before you deploy to an actual production server.




回答3:


I find a solution for my problem, I used pageKite to solve my problem. pagekite gave me an alternative to my localhost by mapping my localhost to a real domain. so I added that domain to my app in Microsoft and its working.



来源:https://stackoverflow.com/questions/16279427/callback-url-in-skydrive-api-to-localhost

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