Quantcast
Channel: Forum CRM Deployment
Viewing all articles
Browse latest Browse all 997

The authentication endpoint Username was not found on the configured Secure Token Service!

$
0
0

I am using the Microsoft CRM online and trying to create the Contact Entity and it throwing Authenticon endpoint user name not found exception. Could you please help me out how to resolve this? I have seen lot of forums but didn't found the solution.

Could you please help me out how to resolve this ?

OrganizationServiceProxyserviceProxy;

ClientCredentialsdeviceCredentials = null;

ClientCredentialsclientCredentials = null;

GuidcontactId = Guid.Empty;

//Organization URL

UriOrganizationUri = newUri("Entered Organization endpoint");

//Discovery URL

UriHomeRealmUri = newUri("Entered Discovery address");

//Setting Client Credentials

clientCredentials = GetCredentials("Entered the User Name","Entered my Password");

//Get the Device Id and Password

deviceCredentials =this.GetDeviceCredentials();

   clientCredentials.Windows.ClientCredential =CredentialCache.DefaultNetworkCredentials;

//Using Organization Service Proxy to instantiate the CRM Web Service

using(serviceProxy = newOrganizationServiceProxy(OrganizationUri, HomeRealmUri, clientCredentials, deviceCredentials))

{

// This statement is required to enable early-bound type support.

serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(newProxyTypesBehavior());

IOrganizationServiceservice = (IOrganizationService)serviceProxy;

//Define Entity Object

Entitycontact = newEntity("contact");

//Specify the attributes

contact.Attributes["lastname"] = txtFName.Text;

//Execute the service

contactId = service.Create(contact);

//Confirmation Message

message = "Contact Created with LastName:-"+ txtFName.Text +" Guid is"+ contactId.ToString();

---------------------------------------------------------

protectedvirtualClientCredentialsGetCredentials(stringusername,stringpassword)

{

ClientCredentialscredentials = newClientCredentials();

credentials.UserName.UserName = username;

credentials.UserName.Password = password;

returncredentials;

}

protectedvirtualClientCredentialsGetDeviceCredentials()

{

returnMicrosoft.Crm.Services.Utility.DeviceIdManager.LoadOrRegisterDevice();

}


Viewing all articles
Browse latest Browse all 997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>