[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:
- 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!
June 12, 2019 at 2:43 pm |
Hi
How to undo the steps because im unable to remove those steps
July 2, 2019 at 7:25 pm |
Hi! Thanks for leaving a comment. I’m not entirely sure what your question is. If you want to revert the changes made, simply edit the file again, remove the changes and use the PUT option to save it.