Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8345419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:39:57+00:00 2026-06-09T06:39:57+00:00

The CRM 2011 is setup with ADFS and HTTPS. I’m trying to connect to

  • 0

The CRM 2011 is setup with ADFS and HTTPS. I’m trying to connect to organization.svc from custom web page which sits on the same IIS with CRM 2011 but as a different web site using this code:

OrganizationServiceProxy serviceProxy;
ClientCredentials clientCredentials = new ClientCredentials();
clientCredentials.UserName.UserName = "admin";
clientCredentials.UserName.Password = "pass";

Guid contactId = Guid.Empty;

Uri OrganizationUri = new Uri(String.Format("https://organization.crmdev.com:port/XRMServices/2011/Organization.svc"));

Uri HomeRealmUri = new Uri(String.Format("https://organization.crmdev.com:port/XRMServices/2011/Discovery.svc"));

using (serviceProxy = new OrganizationServiceProxy(OrganizationUri, null, clientCredentials, null))
{
    serviceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
    IOrganizationService service = (IOrganizationService)serviceProxy; 
    Entity contact = new Entity("contact");
    contact.Attributes["lastname"] = "oi oi";
    contactId = service.Create(contact);
}

It returns error message:

An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.ID3242: The security token could not be authenticated or authorized.

and in the event viewer I see error:

Account For Which Logon Failed:
    Security ID:        NULL SID
    Account Name:       admin
    Account Domain: 
Failure Reason:     Unknown user name or bad password.

although I give the correct user name and password..

and if I try to replace:

using (serviceProxy = new OrganizationServiceProxy(OrganizationUri, null, clientCredentials, null))

with:

using (serviceProxy = new OrganizationServiceProxy(OrganizationUri, HomeRealUri, clientCredentials, null))

it returns:

Object reference not set to an instance of an object.

because serviceProxy is null.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:39:58+00:00Added an answer on June 9, 2026 at 6:39 am

    I’ve finally figured it out 🙂

    I was missing the “/organization”, meaning the organizationUri should be:

     Uri OrganizationUri = new Uri(String.Format("https://organization.crmdev.com:port/organization/XRMServices/2011/Organization.svc"));
    

    I’ve figured it out when I used this code:

    IDiscoveryService discoveryService = new DiscoveryServiceProxy(discoveryUri, null, userCredentials, null);
    
                RetrieveOrganizationRequest orgRequest =
                                            new RetrieveOrganizationRequest()
                                            {
                                                UniqueName = "organization name",
                                                AccessType = EndpointAccessType.Default,
                                                Release = OrganizationRelease.Current
                                            };
                RetrieveOrganizationResponse org =
                        (RetrieveOrganizationResponse)discoveryService.Execute(orgRequest);
    

    And saw the endpoins that the organization have include the “/organization” in the Uri..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to connect to CRM 2011 on premise from windows azure worker
I'm trying to install MS CRM 2011, and I continually get the Action Microsoft.Crm.Setup.Server.InstallConfigDatabaseAction
I have a custom workflow in CRM 2011 which is manually triggered against custom
Connecting to outside Web Services from Dynamics CRM 2011 online works from a US
I'm trying to hide the Settings area in CRM 2011 such that it is
I am querying data from CRM 2011 using FetchXML to build a report in
I have a custom ribbon button on one of my CRM 2011 entities that
We are using CRM 2011 w/ ADFS 2.0. Our users would like for one
I implemented one custom workflow in in Visual Studio 2010 using CRM 2011 Developer
I am trying to get to grips with MS Dynamics CRM 2011. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.