function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ManiKannanManiKannan 

LOGIN_MUST_USE_SECURITY_TOKEN: Invalid username, password, security token; or user locked out.-

Hi All,

This is i am writing the code to be listed below.

Imports SalesForceWebservice
Imports SForce

Partial Class _Default
    Inherits System.Web.UI.Page
    Private _userId As String = "kanmani84@gmail.com"
    Private _password As String = "mani2104"
    Private _sessionId As String
    Private _serverUrl As String
    Private _nextLoginTime As DateTime
    Private _LoginURL As String = "https://na6.salesforce.com/sserv/frontdoor.jsp?sid="
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      Check()
    End Sub


 Sub check()

        Try
            Dim lr As SForce.LoginResult = sfdc.login("kanmani84@gmail.com", "mani2104")
            sfdc.Url = lr.serverUrl
            sfdc.SessionHeaderValue = New SForce.SessionHeader()
            sfdc.SessionHeaderValue.sessionId = lr.sessionId
            Label1.Text = "The session id is: " + lr.sessionId
            Label1.Text += "<br />The new server url is: " + lr.serverUrl
        Catch ex As Exception
            Label1.Text = ex.ToString()

        End Try

    End Sub
end class

  After i run the program this error message is coming . how to solve this problem. if any one help me. Very urgent needs.

This the Error message i listed below

System.Web.Services.Protocols.SoapException: LOGIN_MUST_USE_SECURITY_TOKEN: Invalid username, password, security token; or user locked out. Are you at a new location? When accessing Salesforce--either via a desktop client or the API--from outside of your company’s trusted networks, you must add a security token to your password to log in. To receive a new security token, log in to Salesforce at http://www.salesforce.com and click Setup | My Personal Information | Reset Security Token. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at SForce.SforceService.login(String username, String password) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sfleadlookup\9467f327\80e7e73a\App_WebReferences.8bzmrpb7.1.cs:line 304 at _Default.check() in F:\Sample_Projects\SFLeadLookup\Default.aspx.vb:line 52


  Plz Very Urgent


With Regard,

K.Mani
Sofent Technologies
SuperfellSuperfell
Did you follow the instructions in the error message ?

"Invalid username, password, security token; or user locked out. Are you at a new location? When accessing Salesforce--either via a desktop client or the API--from outside of your company’s trusted networks, you must add a security token to your password to log in. To receive a new security token, log in to Salesforce at http://www.salesforce.com and click Setup | My Personal Information | Reset Security Token."
ManiKannanManiKannan
Did you follow the instructions in the error message ?

"Invalid username, password, security token; or user locked out. Are you at a new location? When accessing Salesforce--either via a desktop client or the API--from outside of your company’s trusted networks, you must add a security token to your password to log in. To receive a new security token, log in to Salesforce at http://www.salesforce.com and click Setup | My Personal Information | Reset Security Token."
 

Cheers
Simon
find more answers in the API docs


Thanks Simon,


Each and every time the security token is changed.if i goto sales force.com and login after i chnage my password. its automatically changed the security Token. Plese tell me one simeple example . how to integreate the vb.net web application with sales force.com. give sample one example. i am waiting favorable reply from you.


with regards,

K.Mani

Sofent Technologies.



Message Edited by ManiKannan on 09-14-2008 11:39 PM