How access to instance of Dynamics 365 ??


I am developing an APP with Xamarin.Forms, and I need to access the data hosted on my Dynamics 365 platform..
In the developer resources section, Microsoft offers me a URL for access: https: // and a Client ID.

With this data, is it enough to access to the platform? According to the Microsoft documentation, I need to register the APP in Active Directory but following the steps indicated in it I have not managed to connect.

But the Client ID offered to me when registering the APP in Azure is totally different from the one offered in the platform. I have also obtained the access credentials but there is no way.

I have the following code.

Values ​​of the constants:

Constantes.API_URL = https: //
Constantes.CLIENT_ID = By registering the application at Active Directory (Not the one that they give me in the platform)
Constantes.CLIENT_KEY = By registering the application at Active Directory.

    AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(
                    new Uri(Constantes.API_URL)).Result;

        String authorityUrl = ap.Authority;
        String resourceUrl = ap.Resource;

        //return resourceUrl;
        ClientCredential creditential = new ClientCredential(Constantes.CLIENT_ID, Constantes.CLIENT_KEY);
        AuthenticationContext authContext = new AuthenticationContext(authorityUrl, false);

        AuthenticationResult result = null;

        result = await authContext.AcquireTokenAsync(resourceUrl, creditential);

        return result.AccessToken;


Sign In or Register to comment.