2013-02-14 1 views
3

MVC3 웹 프로젝트를 Azure에 게시했습니다. fb로 권한을 부여하려 할 때 아래 오류가 나타납니다.MVC3 웹 프로젝트 오류 : "액세스 권한 10.10.0.1:3128에 의해 금지 된 방식으로 소켓에 액세스하려고했습니다."

추가 정보 :

앱에서 다음 권한을 부여합니다. FB, AddSocialAccount 조치로 이동하고 문자열하는 int 실패

var profile = this.Provider.GetUserProfile(code); 

가 간다 :

protected override Task<AccessGrant> PostForAccessGrantAsync(string accessTokenUrl, NameValueCollection request) 
    { 
     return this.RestTemplate.PostForObjectAsync<NameValueCollection>(accessTokenUrl, request) 
      .ContinueWith<AccessGrant>(task => 
      { 
       string expires = task.Result["expires"]; 
       return new AccessGrant(task.Result["access_token"], null, null, expires != null ? new Nullable<int>(Int32.Parse(expires)) : null); 
      }); 
    } 

및 오류와 문자열 인

string expires = task.Result["expires"]; 

오류 :

Server Error in '/' Application. 
enter code here 
An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
Exception Details: System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128 
Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
Stack Trace: 
[SocketException (0x271d): An attempt was made to access a socket in a way forbidden by its access permissions 10.10.0.1:3128] 
System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) +6462061 
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception) +271 
[WebException: Unable to connect to the remote server] 
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context) +2233126 
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult) +14 
Spring.Http.Client.WebClientHttpRequest.ExecuteRequestCallback(IAsyncResult result) in f:\bamboo-home\xml-data\build-dir\SPRNETREST-RELEASE-JOB1\src\Spring.Rest\Http\Client\WebClientHttpRequest.cs:246 
[AggregateException: One or more errors occurred.] 
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3548265 
System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) +73 
System.Threading.Tasks.Task`1.get_Result() +10486829 
Project.Social.Facebook.Api.Impl.FacebookOAuth2Template.<PostForAccessGrantAsync>b__0(Task`1 task) in D:\Code\Poll\Project.Social\Facebook\Api\Impl\FacebookOAuth2Template.cs:23 
System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() +81 
System.Threading.Tasks.Task.Execute() +49 

[AggregateException: One or more errors occurred.] 
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) +3548265 
System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification) +73 
System.Threading.Tasks.Task`1.get_Result() +10486829 
Project.Social.Base.OAuth2SocialProvider`4.SetAccessToken(String code) in D:\Code\Poll\Project.Social\Base\OAuth2SocialProvider.cs:49 
Project.Social.Base.OAuth2SocialProvider`4.GetServiceClient(String oauth_verifier) in D:\Code\Poll\Project.Social\Base\OAuth2SocialProvider.cs:66 
Project.Social.Facebook.FacebookProvider.GetUserProfile(String oauth_verifier) in D:\Code\Poll\Project.Social\Facebook\FacebookProvider.cs:26 Project.Areas.FrontEnd.Controllers.ControllersBase.OAuthControllerBase`3.AddSocialAccount(String code, String oauth_verifier) in D:\Code\Poll\Project\Areas\FrontEnd\Controllers\ControllersBase\OAuthControllerBase.cs:112 
lambda_method(Closure , ControllerBase , Object[]) +147 
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +14 
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +214 
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +27 
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +55 
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253 
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21 
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +253 
System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +21 
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +191 
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +324 
System.Web.Mvc.Controller.ExecuteCore() +106 
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +91 
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10 
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +34 
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +19 
System.Web.Mvc.Async.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _) +10 
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +62 
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +48 
System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7 
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22 
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +60 
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9 
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9629708 
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155 

와 함께 로컬 컴퓨터를 사용할 때 Azure의 connectionString 나는이 오류를 얻지 못한다 (나는 도메인과 URL을 fb로 바꾼다). 아이디어를 제공해 주셔서 감사합니다!

+0

아마도 fb sdk로 인증을 시도하고 Spring.Net을 사용하지 말아야합니다. –

+0

10.10.0.1:3128에 대한 액세스를 생각하고 있습니다. Azure에서이 포트로 방화벽을 변경하려면 어떻게해야합니까? (클라우드 서비스 아님) –

답변

2

이 문제가 해결되었습니다. 내 web.config에는 기본 프록시가 있습니다.

<system.net> 
<defaultProxy> 
    <proxy usesystemdefault="True" proxyaddress="http://10.10.0.1:3128" bypassonlocal="True" /> 
</defaultProxy> 

나는 그것을 제거. 권한이 올바르게 작동합니다.

관련 문제