The remote server returned an error: (401) Unauthorized.

OutsourceMyPjct
@OutsourceMyPjct OutsourceMyProject

Server Error in '/Demo-OMP' Application.
The remote server returned an error: (401) Unauthorized.
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.WebException: The remote server returned an error: (401) Unauthorized.

Source Error:

Line 273: finally
Line 274: {
Line 275: webRequest.GetResponse().GetResponseStream().Close();
Line 276: responseReader.Close();
Line 277: responseReader = null;

Source File: c:\Inetpub\wwwroot\Demo-OMP\App_Code\oAuthTwitter.cs Line: 275

2 years 27 weeks ago

Replies

kurrik
@kurrik Arne Roomann-Kurrik

Your request is being rejected because there's an invalid or no authorization context. How are you passing authorization information?

2 years 27 weeks ago
getmalviya
@getmalviya vinay malviya

Please explain in detail,how i can pass..

45 weeks 20 hours ago
getmalviya
@getmalviya vinay malviya

I

45 weeks 20 hours ago
hiral1milestone

same is happned with me.

I make 150 request only per hour.

Is there solution for it?

1 year 51 weeks ago
PitLord1108
@PitLord1108 PitLord1108

I got the same problem. my clinet used to work fine and it gets 401 Unauthorized now.

it seems the oauth_token/Access token of my app is denied.

If I try to open the authorize url, it returns "The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake. "

I try some other app's authorize api url with oauth token. some of them is working fine and ask for authrize app.

Anyone can help me?

my app's authorize url:
https://api.twitter.com/oauth/authorize?oauth_token=561901232-CBZywiSG2zVo7btPLVx9wzrRlgFxqsRkLguJAauP

a working url from another app:
https://api.twitter.com/oauth/authorize?oauth_token=O8dOyrJ3pF1AJfXD84kelhrI4oXunDJNmHORg0jEtg

1 year 51 weeks ago
episod
@episod Taylor Singletary

The first URL you show does not have a request token being sent to oauth/authorize -- that's an access token (you can tell because it has a user ID in the string). You must have some bug in your OAuth process right now that's re-using an existant access token on the authorize step when you should be using the request token you received from oauth/authorize

1 year 51 weeks ago
tweetmysongcom
@tweetmysongcom TWEETMYSONG.COM

I'm experiencing a similar issue. Everything was working just fine and now I am getting the following error.

TwitterAPIException: Exception of type 'TwitterAPIException' was thrown. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at TwitterVB2.TwitterOAuth.WebRequest(Method RequestMethod, String Url, String PostData)
--- End of inner exception stack trace ---
at TwitterVB2.TwitterOAuth.WebRequest(Method RequestMethod, String Url, String PostData)
at TwitterVB2.TwitterOAuth.OAuthWebRequest(Method RequestMethod, String url, String PostData)
at TwitterVB2.TwitterAPI.PerformWebRequest(String Url, String HTTPMethod)
at TwitterVB2.TwitterAPI.Update(String Text)

Nothing has changed. I am able to log into our website using the same API information. So any help on this matter would be greatly appreciated.

1 year 48 weeks ago
WhosInCom
@WhosInCom WhosIn.com

Anyone fix this? We have the same problem, everything was working fine and then it just stopped

"Whoa there!
The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake."

1 year 43 weeks ago
DevMuthana
@DevMuthana Muthana Muhsen

I have created another test app with different settings to see if it can work. Unfortunately, it did not.

1 year 14 weeks ago
pelangsing
@pelangsing Pelangsing

same the issue, any body share to fix this?

1 year 12 weeks ago
Dav1dEdward5
@Dav1dEdward5 David Edwards

any Twitter developers care to tell us how to fix this problem?

I am using the out of the box MVC4 Twitter login with a new Twitter application (tried twice) and I'm getting 401.

1 year 10 weeks ago
DJRoughHouse
@DJRoughHouse Jason Tarr

Anything?

1 year 10 weeks ago
lanl11
@lanl11 lanl

Please help regarding 401

46 weeks 2 days ago
lanl11
@lanl11 lanl

where are twitter developers ?

46 weeks 2 days ago
nipam
@nipam nipam

Hi Guys,

I am not sure you found fix for it or not but below link helped me out so thought of sharing it with you.

http://stackoverflow.com/questions/6267096/the-remote-server-returned-an-error-401-unauthorized-twitter-oauth

Regards,
Nipam Patel

40 weeks 3 days ago
Nirmalse7en
@Nirmalse7en Nirmal

Im also getting same problem help me Twitter Developers ... W R U

The remote server returned an error: (401) Unauthorized.
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.WebException: The remote server returned an error: (401) Unauthorized.

Source Error:

Line 294: finally
Line 295: {
Line 296: webRequest.GetResponse().GetResponseStream().Close();
Line 297: responseReader.Close();
Line 298: responseReader = null;

Source File: g:\TwitterLoginForWebSite\App_Code\oAuthTwitter.cs Line: 296

Stack Trace:

[WebException: The remote server returned an error: (401) Unauthorized.]
System.Net.HttpWebRequest.GetResponse() +6040131
oAuthExample.oAuthTwitter.WebResponseGet(HttpWebRequest webRequest) in g:\TwitterLoginForWebSite\App_Code\oAuthTwitter.cs:296
oAuthExample.oAuthTwitter.WebRequest(Method method, String url, String postData) in g:\TwitterLoginForWebSite\App_Code\oAuthTwitter.cs:268
oAuthExample.oAuthTwitter.oAuthWebRequest(Method method, String url, String postData) in g:\TwitterLoginForWebSite\App_Code\oAuthTwitter.cs:223
TwitterAuthentication.GetUserDetailsFromTwitter() in g:\TwitterLoginForWebSite\TwitterAuthentication.aspx.cs:35
TwitterAuthentication.Page_Load(Object sender, EventArgs e) in g:\TwitterLoginForWebSite\TwitterAuthentication.aspx.cs:19
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207

41 weeks 1 day ago
nipam
@nipam nipam

Hi Nirmal,

I am not sure you found fix for it or not but below link helped me out so thought of sharing it with you.

http://stackoverflow.com/questions/6267096/the-remote-server-returned-an-error-401-unauthorized-twitter-oauth

Regards,
Nipam Patel

40 weeks 3 days ago
midhuna_pp
@midhuna_pp Midhuna P P

The remote server returned an error: (401) Unauthorized.

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.WebException: The remote server returned an error: (401) Unauthorized.

Source Error:

Line 294: finally
Line 295: {
Line 296: webRequest.GetResponse().GetResponseStream().Close();
Line 297: responseReader.Close();
Line 298: responseReader = null;

Please help how to provide authorization information with explanation.

40 weeks 6 days ago
EffulgentGlaive
@EffulgentGlaive Escapable

I've just encountered the same problem here using ASP.NET MVC 4. The solution which worked for me was that I needed to provide some random "Callback URL" in the "Settings" tab of my twitter application. For example: http://www.website.com

39 weeks 2 days ago
sanilgk
@sanilgk sanil g.k

I had this issue in one of my websites.it was occurred due to wrong server time in my case.I changed it,and it worked successfully.

Regards,
Sanil GK

30 weeks 1 day ago
saravan68005674
@saravan68005674 saravanan

I got this error Please help me to solve.

System.Net.WebException was unhandled
HResult=-2146233079
Message=The remote server returned an error: (401) Unauthorized.
Source=System
StackTrace:
at System.Net.HttpWebRequest.GetResponse()
at TwitterOAuth.Program.Main(String[] args) in d:\project\Twitter APP\10Oct2013 Twitter App analyzer URL\TwitterOAuth\TwitterOAuth\TwitterOAuth\Program.cs:line 92
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

26 weeks 1 day ago
Thesocialstock
@Thesocialstock Thesocialstockmarket

Adjusting the server time worked for me, thanks.

9 weeks 2 days ago
Samriti_Singla

plz help me i have also same problem when we request for the access token
plz help me as soon as possible
OAuthutility.GetRequestToken(....)

1 week 2 days ago