Is it possible to config OpenIdConnectAuthentication somewhere outside of the app start like API controller, to be able to have multiple authentications like google or facebook and OpenId Connect and also be able to turn it on or off depend on our needs?
Question posted in Facebook API
The official documentation for the Facebook APIs can be found here.
The official documentation for the Facebook APIs can be found here.
2
Answers
You must configure OWIN in the app start; however, you can configure your scenario inside app start with all the different providers you want to support.
The OpenIdConnectAuthentication (
Microsoft.Owin.Security.OpenIdConnect.OpenIdConnectAuthenticationMiddleware
) you mentioned is a OWIN middleware. The web application which support OWIN starts with a number of steps, you can check the detailed steps from link here.You may consider to use Azure AD B2C tenant which supports Facebook, Google+, LinkedIn, and Amazon and you can easily config the identity provider from Azure portal. More detail about Azure AD B2C, you can check this link.