Skip to main content

Notifications

Dynamics 365 general forum

Azure AD Authentication issue,From Single Page Application .

Posted on by 240

Hello all,

I written the following code in Script.

//Set these variables to match your environment
var organizationURI = "reactiontest.crm8.dynamics.com"; //The URL to connect to CRM (online)
var tenant = "dynamicswebapi@reactiontest.onmicrosoft.com"; //The name of the Azure AD organization you use
var clientId = "GiKcBYCW1bECq1n7R0sInalz/LOqCKEUY+BrYQRNYYg="; //The ClientId you got when you registered the application
var pageUrl = "localhost/SimpleSPA.html"; //The URL of this page in your development environment when debugging.

var user, authContext, message, errorMessage, loginButton, logoutButton, getAccountsButton, accountsTable, accountsTableBody;

..When i click on Login it's not redirect to the Microsoft Login Page it is throwing Error.

MicrosoftLoginError.png

I am unable find root cause ,i followed the all the steps which are provided by Microsoft.

1) https://rajeevpentyala.com/2018/03/24/step-by-step-d-365-server-to-server-s2s-authentication-using-azure-ad-and-application-user/

2) docs.microsoft.com/.../walkthrough-registering-configuring-simplespa-application-adal-js

  • Verified answer
    Sairam89 Profile Picture
    Sairam89 240 on at
    RE: Azure AD Authentication issue,From Single Page Application .

    Thanks , Ravi Kashyap ,it help me to find ,More appropriate answer is following ...

    debajmecrm.com/.../dynamics-crm-cross-origin-resource-sharing-external-application-cors

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Azure AD Authentication issue,From Single Page Application .

    Hi,

    Check this blog for the step by step - debajmecrm.com/.../step-by-step-guide-query-dynamics-crm-web-api-using-server-to-server-authentication-with-application-user

    Hope this helps.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans