I have managed to successfully implement a 'log in using Facebook' button in to my website/heroku app, it works fine when used locally with the site URL and App Domain set to localhost:8080 within the app settings of the Facebook development page.
I have now tried to push the app to heroku to go live, I have changed the Site URL and App Domain to myapp.herokuapp.com, I have set my heroku config using:
heroku config:set FACEBOOK_APP_ID=133333333463066 \ FACEBOOK_SECRET=a7244e333333333a7a2bf9492a6089a0but whenI attempt to use the button I receive this response:
Given URL is not permitted by the Application configuration: One or
more of the given URLs is not permitted 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.
The issue was that I was using:
module.exports = {
'facebookAuth' : {
'clientID' : '663072463821834', // your App ID
'clientSecret' : 'fb87ad1ac64364e3bf42c95766a50e08', // your App Secret
'callbackURL' : 'http://infinite-scrubland-4586.herokuapp.com/auth/facebook/callback'
}
to set my config and I hadn't updated my callbackURL with the appropriate suffix of /auth/facebook/callback.
Related
I have an application I have been developing which is to make use of the Facebook Developers FB.ui share popup:
FB.ui({
display: 'popup',
method: 'share',
href: imgUrl,
quote: imgComment,
}, function (response) { });
This seems to work perfectly when I am developing on localhost:5001 (I have set the following in my FB Dev Application settings):
However, as soon as I publish my application to my Azure hosted site (on the other address I have marked out above) I get the following error when trying to load the FB.ui Share popup:
The URL in the Valid OAuth Redirects URIs matches exactly the location of my Application online on Azure:
so cannot figure out why I am seeing this error when trying to load the Share popup.
The URL in the Valid OAuth Redirects URIs matches exactly the location of my Application online on Azure
The error message wasn't talking about that field, but about the App Domains field.
You find that under Settings -> Basic.
I have an azure web app , which has open id connect authentication configured with Azure AD
For this , i had created a new app under App Registrations in Azure Active Directory and configured the Redirect URL as /signin-oidc . So when i try to login to the app service url , it first redirects to the redirect url and then to https://login.microsoftonline.com and passes the client id ,tenant etc details in the query string and works perfectly fine. So i can login with my azure ad user credentials
The Web Application is working perfectly fine with Open ID Connect with Azure AD.
When i front Azure Web App , with an Azure Application Gateway , it directly redirects to
/signin-oidc and stops there . I tried redirect options also.
Does Azure Application Gateway support -open id connect authentication with Azure AD. ?
Same scenario here, an App Service behind an Application Gateway. Here's what worked:
The BuildRedirectUri method in Microsoft.AspNetCore.Authentication.AuthenticationHandler<> builds the redirect URI concatenating, among other values, the Resquest.Host string. That's why the App Service host was being used instead of the Gateway's.
So, the following code snipped was added to the Configure() method of Startup.cs:
if (env.IsProduction())
{
app.Use((context, next) =>
{
context.Request.Host = new HostString("<gateway.host>");
return next();
});
}
Yes , we can use application gateway with open id authentication. In my case, SSL certificate was missing and i got it working once added.
I've been following the guide in this repo to setup a resource token provider as an Azure function.
https://github.com/adamhockemeyer/Azure-Functions---CosmosDB-ResourceToken-Broker
I've setup the Cosmos DB, App registration, and Azure function with permissions according to the instructions. When I get to step 3 in the guide where I enter https://{function-url}/.auth/login/{provider} into my browser I get the following error.
ADSTS50011: The reply url specified in the request does not match the
reply urls configured for the application: [App id]
Update
I changed the Reply URL in my App Registration to https://{function-url}/.auth/login/{provider}/callback with {function-url} as my Function App URL. Originally I had it set to one of my Function URL's. Now i'm getting a 404 not found error.
App Registration Redirect URL
Function App URL
Function App Authentication Settings
You need to add the URL as below in your app registration, then it should work.
Note: After adding the URl, go back to the Authentication / Authorization in your functionapp, turn off the Authentication Providers whcih you configured -> turn off Authentication / Authorization, then turn on and configure again, otherwise it seems not become effective.
https://{function-url}/.auth/login/{provider}/callback
Update:
Turn off all the configuration and create the new AD App like below.
I am hosting my website on my own server, and using Netlify CMS. However, I would still like to use Netlify's hosted Identity and Git Gateway services, instead of running my own.
Yes, that is possible. First, you will need to set up your site in Netlify, and make sure you have the Identity and Git Gateway services turned on and configured. Follow the regular "Add to Your Site" setup for Netlify CMS, but make these changes:
CMS config.yml changes
The backend section of your config should contain the following three keys. Replace my-site.netlify.com with your Netlify site URL.
backend:
name: git-gateway
identity_url: "https://my-site.netlify.com/.netlify/identity"
gateway_url: "https://my-site.netlify.com/.netlify/git"
CMS index.html changes
Assuming you already have the Netlify Identity script added (netlify-identity-widget.js), remove it and use the netlify-identity.js script from the same package instead. This script will not initialize automatically, which allows us to set our own parameters. Do this on both your admin page and your site homepage.
<script src="https://identity.netlify.com/v1/netlify-identity.js"></script>
Next, add this script right below it, on both the admin page and the home page. Again, replace my-netlify-site.com with your Netlify site URL.
<script>
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", function () {
netlifyIdentity.init({
APIUrl: "https://my-site.netlify.com/.netlify/identity"
});
});
} else {
netlifyIdentity.init({
APIUrl: "https://my-site.netlify.com/.netlify/identity"
});
}
</script>
Recently I created IBM APPID service and download nodejs code from service dash board and deployed on IBM cloud. As per instruction in dashboard it should work with default settings and no need to do additional setting in identity providers
But when I clicked on login but it gives me below error on redirect
{"error":"invalid_request","error_description":"redirect_uri doesn\'t belongs to the clientID"}
Not sure but is it something to do with redirect URL on identity providers-> manage page or something else
My understanding is that I downloaded nodejs code is from APPid service and it should work with default configuration of service
Manage page
App.js code
const LOGIN_URL = "/ibm/bluemix/appid/login";
const CALLBACK_URL = "/ibm/bluemix/appid/callback";
Have you clicked on the edit button and insert facebook\google App id\Client ID or password?
If you did so you aren't using default configuration anymore and need to follow the instructions of adding appid's redirect URL to facebooke\google and add your redirect to appid in the lower box