web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Authenticating to Dynamics 2011 CRM from mobile app

(0) ShareShare
ReportReport
Posted on by

Hi all,

I'm developing a mobile application to access my company's CRM system which uses Dynamics 2011. We use ADFS to authenticate. I am writing the application in react-native and have looked around for some resources, but they're sparse. I'm looking not to use auth0 or miniOrange for ADFS authentication because we don't want to pay their fees. Is this possible? We were thinking we would need to set up a web service in C# to make the authentication endpoint available from the app. What is the best route to go in this case? Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Andreas Cieslik Profile Picture
    9,267 on at

    This JavaScript library made by Jason Lattimer can help you to deal with it:

    gist.github.com/.../bfeffb02d3efd159d0af

    his blog entry:

    community.dynamics.com/.../soap-authentication-to-crm-on-premise-adfs-using-javascript

  • EmployeeOcta Profile Picture
    6 on at

    I think you can create web api and using c# and call that from the mobile app.

    that will be a good approach, but depends on the system is on premise and no idea moving to on line.

  • Community Member Profile Picture
    on at

    Thanks for the link. It helps a lot. I'm currently trying to get the adfs URL from his function Xrm.CRMAuth.GetADFS. However, it makes a synchronous call and that isn't allowed in react-native. I ran the code on a desktop application and got the adfs url that way and am simply returning that value in that function, commenting out the synchronous api call. When my application tries to authenticate, I get this error: "An SSL error has occurred and a secure connection to the server cannot be made." Is this because my ADFS has not yet been configured to allow my application access? Do you know the steps to configure ADFS to allow mobile apps access? Thanks a lot man!

  • Suggested answer
    Andreas Cieslik Profile Picture
    9,267 on at

    Sound like you ran into this issue if you are using Apple iOS:

    stackoverflow.com/.../ios9-getting-error-an-ssl-error-has-occurred-and-a-secure-connection-to-the-ser

  • Community Member Profile Picture
    on at

    I added the lines in my info.plist and the same error: "An SSL error has occurred and a secure connection to the server cannot be made." keeps occurring.... Man I'm stumped.. No idea how to talk to the ADFS server to get the SOAP authentication header!

  • Andreas Cieslik Profile Picture
    9,267 on at

    Here is another one:

    stackoverflow.com/.../an-ssl-error-has-occurred-and-a-secure-connection-to-the-server-cannot-be-made

    Seems like an iOS specific issue. Maybe you should better ask in an iOS developer forum.

  • Community Member Profile Picture
    on at

    We upgrade our TLS version to 1.2 and now I'm finally able to talk to the ADFS server. I receive an XML envelope back, and receive a FailedAuthentication error when I make the POST request to authenticate. The body of the message says "ID3242: The security token could not be authenticated or authorized."  Any clues?

  • Community Member Profile Picture
    on at

    Update:

    We updated our CRM and ADFS servers to use TLS1.2.

    I'm getting a different error now in my react-native application:

    "The security token could not be authenticated or authorized"

    And in my ADFS tracing log, I see the error:

    ID4063: LogonUser failed for the <domain_name> user. Ensure that the user has a valid Windows account.-Logon failure: unknown user name or bad password

    Not sure why I am getting this error, because I can sign in to the CRM deployment no issue from a regular browser.

    Any help would be appreciated. Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans