[Azure] AAD “You do not have permission to view this directory or page.”

I ran into this error debugging my Cordova app from Visual Studio, running the debugger locally instead of on my device. After logging into Azure Active Directory with valid credentials, the page would display this error:

“You do not have permission to view this directory or page.”

As this was the second time I had to figure out how to solve it, thought I’d do a quick post on it for my own future reference 🙂 

The solution is very simple once you know where to look:

  • Open up the Azure management portal and browse to your App Service instance.
  • Click Resource Explorer => Go to launch the resource explorer which allows you to browser and edit files.
  • Expand the config node and click authSettings. This will open up a JSON file.
  • Before you can edit the file, you need to set the application in read/write mode:
    azure_readwrite

    And click the Edit button just above the editor itself:
    azure_edit

  • Now search for the allowedExternalRedirectUrls node, it’s probably set to null if you haven’t changed it before.
  • Now put in a JSON array of URL’s that you want to allow. In my case, I had to put in localhost:4400 as that is where the Cordova app is running:
    "allowedExternalRedirectUrls": [
         "http://localhost:4400",
         "https://localhost:4400"
    ],
  • Click “PUT” to save the file back to the server.

That’s it! This should resolve the error and your authflow will hopefully start having as expected!

 

, ,

Related posts

Long Term Support… or not?

I ran into this error debugging my Cordova app from Visual Studio, running the debugger locally instead of on my device. After logging into Azure Active Directory with valid credentials, the page would display this error:

"You do not have permission to view this directory or page."

As this was the second time I had to figure out how to solve it, thought I'd do a quick post on it for my own future reference :) 

[DevOps] Should you migrate onto YAML release pipelines?

I ran into this error debugging my Cordova app from Visual Studio, running the debugger locally instead of on my device. After logging into Azure Active Directory with valid credentials, the page would display this error:

"You do not have permission to view this directory or page."

As this was the second time I had to figure out how to solve it, thought I'd do a quick post on it for my own future reference :) 

Latest posts

Long Term Support… or not?

I ran into this error debugging my Cordova app from Visual Studio, running the debugger locally instead of on my device. After logging into Azure Active Directory with valid credentials, the page would display this error:

"You do not have permission to view this directory or page."

As this was the second time I had to figure out how to solve it, thought I'd do a quick post on it for my own future reference :) 

[DevOps] Should you migrate onto YAML release pipelines?

I ran into this error debugging my Cordova app from Visual Studio, running the debugger locally instead of on my device. After logging into Azure Active Directory with valid credentials, the page would display this error:

"You do not have permission to view this directory or page."

As this was the second time I had to figure out how to solve it, thought I'd do a quick post on it for my own future reference :) 

2 comments

Leave a Comment

Leave a Reply to venu Cancel reply

Your email address will not be published. Required fields are marked *