Friday, January 22, 2016

No authUri provided nor found in O365Auth.authUri

Hi All,

While building an Apache Cordova app to integrate with Office 365  API. I connected my cordova app with office 365 by using Add -> Connected Service option in Visual Studio 2015. When i run my Cordova app try to login to office 365. I am getting the following error:

 No authUri provided nor found in O365Auth.authUri

I am using Microsoft.Office365.ClientLib.JS which allow developers to integrate with office 365 services.



The error because the Setting variable is not defined in O365Auth object. So add the follow code in o365auth.js file:


var O365Auth;
(function (O365Auth) {
    var Token = (function () ....)();
    O365Auth.Token = Token;

  //  define settings
    var Settings = {
        clientId: '6de88843-3a72-484c-af8d-3f26d2c3dd52',
        authUri: 'https://login.microsoftonline.com/common/',
        redirectUri: 'http://localhost:4400/services/office365/redirectTarget.html',
        domain: 'MostafaTenant.onmicrosoft.com',
        tenantId: '3323232-13e6-232323-a52a-323234423232'
    };

    O365Auth.Settings = Settings;


Run your project and the rest of your code will pull o365 settings :-)

Hope this helps.


Post a Comment