Reputation: 237
So I have created a MVC application .net framework that uses Microsoft graph api.and it uses Azure redirect uri for authentication. I had http://localhost:#### and it was working fine locally. now I published the app in IIS and need to change the redirect URI. Azure only accepts something that says starts with localhost or https. I dont have SSL certificate in IIS to do https so I was wanting to make it work with http. Singon url and redirect url are both http?
I have tried bit.ly to redirect to the http. I even registered new app in azure and gave a new signon url and changed on the webconfig. but now it says the page you are looking for cannot be displayed an invalid method of http verb.
Upvotes: 2
Views: 4180
Reputation: 44
You can set your Azure redirect uri for authentication as "https://yourdomain.com" even if it's not. Then in your application start:
if (environment.production) {
if (location.protocol === 'https:') {
window.location.href = location.href.replace('https', 'http');
}
}
This worked for my Angular SPA Application
Upvotes: 0
Reputation: 16458
Yes. Azure AD has the Restrictions on redirect URLs.
If you don't have an SSL certificate, it's a good idea to create self signed certificates for https domain.
You can refer to an earlier post: Trust a self signed cert from IIS
Upvotes: 1