You need to sign in to do that
Don't have an account?
Authenticating self-service users
I need to authenticate self-service users, but don't want to use the self-service login page (I want to create a new page that accepts self-service username and password).
I don't want to create a user database to authenticate the self-service users as suggested in other posts, and I also don't want to use a single password solution as suggested in other posts.
From the documentation this may be done through LoginScopeHeader, but I can't find any code samples that do that.
Does anybody have a good sample that authenticates an existing self-service user? (using LoginScopeHeader or not)
stub = new Sforce.SforceService();
stub.LoginSCopeHeaderValue = new sforce.LoginScopeHeader();
stub.LoginSCopeHeaderValue.organizationId = "00D......";// whatever your 18 char organizationId is
sforce.LoginResult lr = stub.login("selfserve@foo.org", "saas");
Cheers
Simon
Dim oProxy As New SforceService
Dim oLoginResult As New LoginResult()
Dim LoggedInSelfServiceUserID As String = ""
' SelfServiceUser authentication
Dim oSelfServiceUser As New SelfServiceUser
Dim oLoginScopeHeader As LoginScopeHeader = New LoginScopeHeader()
oLoginScopeHeader.organizationId = sOrganizationID
oProxy.LoginScopeHeaderValue = oLoginScopeHeader
Try
oLoginResult = oProxy.login(SelfServiceUserID, SelfServicePassword)
LoggedInSelfServiceUserID = oLoginResult.userId
Return True
Catch ex As Exception
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(ex)
Return False
End Try
' ******************************************************************************
' SelfServiceUser has been authenticated, but they have no access to the API
' Re-Login with regular user credentials to access the API
oProxy = New sForce.SforceService
Try
oLoginResult = oProxy.login(APIUserID, APIUserPassword)
Catch ex As Exception
Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManager.Publish(ex)
Return False
End Try
End Function