使用默认的ASP.Net MVC设置,如何使用Microsoft帐户登录? [英] Using default ASP.Net MVC setup, how do I Sign in using a Microsoft Account?

查看:145
本文介绍了使用默认的ASP.Net MVC设置,如何使用Microsoft帐户登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我不断收到输入参数'redirect_uri'提供的值无效."

Why do I continuously receive "The provided value for the input parameter 'redirect_uri' is not valid."?

我的网站托管在Azure中.我正在尝试通过Microsoft登录按钮登录.我没有对默认的ASP.Net MVC即用型模板进行很多更改.我真正改变的只是取消注释app.UseMicrosoftAccountAuthentication行,并添加了 clientId clientSecret .

My site is hosted in Azure. I'm trying to Login via the Microsoft sign-in button. I haven't really made many changes from the default ASP.Net MVC out-of-the-box template. All I've really changed was to uncomment the app.UseMicrosoftAccountAuthentication line and add the clientId and clientSecret.

我的重定向URL设置不正确吗?

Do I have the Redirect URL set up incorrectly?

站点: http://mysite.azurewebsites.net

重定向URL: http://mysite.azurewebsites.net/

我在某处读到您需要以http://www.mysite.azurewebsites.net的形式指定重定向URL.任何人都可以确认或否认吗?我在当前设置中不需要 www .

I read somewhere that you need to specify a Redirect URL in the form of http://www.mysite.azurewebsites.net. Can anyone confirm or deny that? I do not need the www in my current set up.

我始终收到的错误是:

https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=输入参数'redirect_uri'的提供的值无效.期望值为" https://login.live.com/oauth20_desktop.srf "或一个与为此客户端应用程序注册的重定向URI匹配的URL.& state = SomeLongPossfullyEncryptedString

https://login.live.com/err.srf?lc=1033#error=invalid_request&error_description=The provided value for the input parameter 'redirect_uri' is not valid. The expected value is 'https://login.live.com/oauth20_desktop.srf' or a URL which matches the redirect URI registered for this client application.&state=SomeLongPossiblyEncryptedString

此消息显示在尝试登录后返回的页面上:

This message is displayed on the page returned after an attempt to login:

Microsoft帐户

我们无法完成您的请求

Microsoft帐户遇到技术问题.请稍后再试.

Microsoft account is experiencing technical problems. Please try again later.

2014/3/26更新:到目前为止还没有运气,这里是我的设置的一些屏幕截图,以防万一. 基本信息

API设置

这是微软方面的问题,还是我做错了什么?

Is this a problem on Microsoft's side or am I doing something wrong?

推荐答案

在默认的MVC中,重定向网址最适合我的方式(刚刚在5分钟前进行了测试)

From the default MVC what works for me (just tested about 5 minutes ago) for the redirect URL is

http://testcrap.azurewebsites.net/ Signin-microsoft

我发现可以使用的所有文档

All the documentation I've found says to use

http://testcrap.azurewebsites.net/ 登录/microsoftaccount

但这对我不起作用... signin-microsoft 可以

But that doesn't work for me... signin-microsoft does

或者,如果这不起作用,则使用萤火虫之类的东西来查看对oauth提供程序的请求,然后您需要使用该请求中的redirecturi..

OR if that doesn't work then use something like firebug to see what the request to the oauth provider looks like and then whatever the redirecturi is inside of that request is what you need to use..

这篇关于使用默认的ASP.Net MVC设置,如何使用Microsoft帐户登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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