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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

MS CRM 2013 Online web services authentication from iframe and impersonation

(0) ShareShare
ReportReport
Posted on by 65

Hello,

We have an ASP.NET MVC 4 application that runs inside an iframe in MS CRM 2013. The web application uses the MS CRM web services (Organization web service) to retrieve and save data. To do so, it needs to authenticate. For on-premises we are using windows authentication and impersonate with the currently logged user in MS CRM (user id is passed to the iframe URL). It works like a charm.

How can we achieve this in MS CRM 2013 Online? Impersonation itself should not be a problem but how can our application authenticate to the MS CRM web services on the first place? Multiple MS CRM customers may use our application, so configuration from our customers' point of view should not be too hard (actually it should be as simple as possible). 

A similar question have been asked here: https://community.dynamics.com/crm/f/117/p/76370/265655.aspx#265655. In this post we get to a user with the "delegate" privilege which will be used for the initial authentication and then impersonation is done. It is all fine but from where do we get the credentials to use such a user. I suppose this user should be created first and his credentials stored somewhere in the application in order to be retrieved and used when authentication is required but it still does not seem right and much more complex than what is done in salesforce.

Thanks in advance!

Enoch

*This post is locked for comments

I have the same question (0)
  • Verified answer
    ScottDurow Profile Picture
    21 on at

    Hi,

    The standard approach that ISV's take is for the user to provide the username and password of a user with act on behalf rights in their security role - these details are then stored securely by the ISV and then used to call the SDK web services on the current user's behalf - all that needs to be provided to the IFRAME is a user Id which is usually stored in a session with a security token that has a timeout.

    With CRM2013 now supporting OAuth you might consider using this approach since it is more secure - blogs.msdn.com/.../use-oauth-to-authenticate-with-the-crm-service.aspx

    Hope this helps,

    Scott

  • Enoch Wallace Profile Picture
    65 on at

    Hi Scott,

    Thank you very much for your reply!

    Let's say we go for the OAuth approach. In our case the user is already logged in to MS CRM Online because he/she is opening our application in an iframe within MS CRM. Will the user still be asked for credentials or he/she will be immediately redirected back to our application with the token because he/she is already logged in? It will not be practical if the user is asked for credentials again. Our goal is to simplify user experience as much as possible and avoid prompting for credentials and/or storing these credentials.

    Thanks again,

    Enoch

  • Muhammad Naderi Profile Picture
    135 on at

    may I ask about the results?

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans