Url Redirection in Azure Active Directory - redirect

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.

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

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

Related

OAuth2 redirect URI for enterprise application

I'm working on an enterprise application and our UI is a web application. We are looking to add OAuth2 support and I don't understand what to provide for the redirect URI field to the OAuth provider.
For example, I have registered my app in github OAuth provider.
Homepage URL: https://localhost:7980/index.html
Authorization callback URL: https://localhost:7980/oauth_callback
Now this works fine with localhost as the hostname. But, when this application gets used by the customers they can install it on any of their boxes and invoke the web app from any device connected to our server via https://[hostname]:7980/index.html. In this case, if the customer wants to use OAuth2 authentication option, then I don't understand what should be the redirect URL. Obviously I cannot use localhost for redirect URL as the customer can access the web app from any machine. I wouldn't know the machine ip/hostname where the customers are going to be installing our server beforehand.
One suggestion was to use a server from our company which would handle redirect URLs for the OAuth2 authentication. Is this a good idea? Is there a standard way for handling the use case I have narrated above in OAuth2?

What is the best way to secure your backend code with SSL?

I am newbie here. Trying to set up an end to end service running.
Here is my scenario:
frontend is hosted in heroku.
backend is spring-boot and server is hosted in AWS.
My backend service has integrated the facebook Oauth2 login, for which I must provide a redirect URL which is https. To handle that I created a self signed certificate and secured my backend service with the same.
Everything is working fine till here except the security warning users will get in the browser as the certificate is self signed. AFAIK I must get a CA root certificate to avoid this. but to get the CA root certificate i need to provide the domain i will be protecting. For the backend server there is no domain, it will just be a static ip.
Can someone please guide me as to what is the correct approach here ?

Facebook login flutter app error

I have encountered the following FB error:
Given URL is not allowed by the application configuration: One or more
of the given URL is not allowed by the App's settings. To use this URL
you must add a valid native platform in your App's settings.
Also Facebook OAuth redirect URI, does not accept http local host.
You may need to review the OAuth settings for your Facebook application
Also Facebook OAuth redirect URI, does not accept http local host
HTTPS is required for new Facebook integrations. You can get free certificates from Lets Encrypt or use self-signed certs and add them to your mobile device. It's a little more complicated, but it's really for the best :-)

Meteor accounts-facebook not working on server

I have followed the this tutorial (http://bulenttastan.net/login-with-facebook-using-meteor-js/) to setup Meteors accounts-facebook package. The application worked fine while working on the local environment(localhost).
Now that I have hosted the app on my server I have the following configuration on my Facebook Apps Dashboard.
But when I try to login from my application I receive the following error message:
"URL Blocked: This redirect failed because the redirect URI is not whitelisted in the app’s Client OAuth Settings. Make sure Client and Web OAuth Login are on and add all your app domains as Valid OAuth Redirect URIs."
My app is hosted on the port '3002' so, I have set the port along with the domain name on the Site URL section on facebook and with respect to the site URL I have also set the redirect URI as given on the image.
Thanks in Advance.
Found a Fix! Setting the ROOT_URL environment variable did the trick for me.

Given URL is not allowed by the Application configuration

I've been testing my app using my company's domain (which has ssl installed) and works like a charm.
now, I want this app to have its own domain, server and SSL certificate. I purchased a Godaddy SSL certificate(Standard (Turbo) SSL) and asked my hosting to install it, which they did and seems to be working ok...
now when I change the Facebook App settings to my new server, it just fails to load, and the console just outputs "Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. "
Im completely lost on what to do... the settings are like this
Im loading FB using the facebook-actionscript-api 1.8.1
Namespace: myfbapp
App domains: myfbapp.com www.myfbapp.com
Sandbox: disabled
Canvas URL: http://www.myfbapp.com
Secure c url: https://www.myfbapp.com
needed to get a dedicated IP for my game and attach the SSL to it