首页 > 解决方案 > Cordova Microsoft CRM 2011 get AuthToken

问题描述

I'm using Cordova v8.0.0 and trying to get the Access Token from an On-Premises MS Dynamics CRM 2011.

I'm running the below but it is just redirecting to a page that doesn't exist as below.

https://sts.orgdomain.com/adfs/oauth2/authorize?response_type=code&client_id=xxxx-xxxx-xxxx-xxxx-xxxx

I'm running the code below

var resource = 'https://crm.orgdomain.com';
var clientId = 'xxxx-xxxx-xxxx-xxxx-xxxx';
var redirectUri = 'msauth://com.domain.app/llbcvRoS2B87ZqPE8YbTtZdCziA%3D';
var authContext = new Microsoft.ADAL.AuthenticationContext(xhr.responseURL, false);
var authresult = authContext.acquireTokenAsync(resource, clientId, authorization_URI);

Any one know why.enter image description here

标签: cordovadynamics-crmcrmadfsadal

解决方案


推荐阅读