I have downloaded Microsoft.Owin.Security.Facebook package in order to be able to integrate Facebook as external login provider. I have added it to the app builder as follows:
And, of course, in https://developers.facebook.com I have registered my app in order to obtain App ID and App secret. I have registred the custom user service in the standart way:
public class CustomUserService : UserServiceBase
{
....
// gets called whenever the user uses external identity provider to authenticate
// now we will try to map external user to a local user
public override Task AuthenticateExternalAsync(ExternalAuthenticationContext context)
....
}
And then in Startup.cs:
// use custom user service
var customUserService = new CustomUserService();
idServerServiceFactory.UserService = new Registration<IUserService>(resolver => customUserService);
In the login screen I have Facebook as an option. I can select it, I can navigate to it and successfully enter my credentials. The problem happens right after I get back from Facebook to my Identity Server 3 implementation.
The message in the browser is:
There was an error logging into the external provider. The error message is: access_denied
Browser url is:
https://localhost:44317/identity/callback?error=access_denied#_=_
I have downloaded Microsoft.Owin.Security.Facebook package in order to be able to integrate Facebook as external login provider. I have added it to the app builder as follows:
And, of course, in https://developers.facebook.com I have registered my app in order to obtain App ID and App secret. I have registred the custom user service in the standart way:
And then in Startup.cs:
In the login screen I have Facebook as an option. I can select it, I can navigate to it and successfully enter my credentials. The problem happens right after I get back from Facebook to my Identity Server 3 implementation.
The message in the browser is:
There was an error logging into the external provider. The error message is: access_denied
Browser url is:
https://localhost:44317/identity/callback?error=access_denied#_=_
And the one from the logs:
NOTE: I never hit a breakpoint inside of
public override Task AuthenticateExternalAsync(ExternalAuthenticationContext context)
If it is going to help, I am running the instance of Identity Sever 3 on localhost.