The [Account Module](../Modules/Account.md) has already configured to handle social or external logins out of the box. You can follow the ASP.NET Core documentation to add a social/external login provider to your application.
### Example: Facebook Authentication
Follow the [ASP.NET Core Facebook integration document](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/facebook-logins) to support the Facebook login for your application.
#### Add the NuGet Package
Add the [Microsoft.AspNetCore.Authentication.Facebook](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.Facebook) package to your project. Based on your architecture, this can be `.Web`, `.IdentityServer` (for tiered setup) or `.Host` project.
#### Configure the Provider
Use the `.AddFacebook(...)` extension method in the `ConfigureServices` method of your [module](../Module-Development-Basics.md), to configure the client:
````csharp
context.Services.AddAuthentication()
.AddFacebook(facebook =>
{
facebook.AppId = "...";
facebook.AppSecret = "...";
facebook.Scope.Add("email");
facebook.Scope.Add("public_profile");
});
````
> It would be a better practice to use the `appsettings.json` or the ASP.NET Core User Secrets system to store your credentials, instead of a hard-coded value like that. Follow the [Microsoft's document](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/social/facebook-logins) to learn the user secrets usage.
@ -437,7 +437,11 @@ See the [Testing Overview](https://reactjs.org/docs/testing.html) document.
* [Formik](https://github.com/jaredpalmer/formik) is used to build forms.
* [Yup](https://github.com/jquense/yup) is used for form validations.
## Social / External Logins
If you want to configure social/external logins for your application, please follow the [Social/External Logins](../Authentication/Social-External-Logins.md) document.
## What's Next?
- [The getting started document](../Getting-Started-With-Startup-Templates.md) explains how to create a new application in a few minutes.
- [The application development tutorial](../Tutorials/Part-1) explains step by step application development.
- [The getting started document](../Getting-Started.md) explains how to create a new application in a few minutes.
- [The application development tutorial](../Tutorials/Part-1.md) explains step by step application development.
You can now run the `.DbMigrator` console application to **migrate** the **database schema** and **seed** the initial data.
{{else if DB=="Mongo"}}
You can now run the `.DbMigrator` console application to **seed** the initial data.
{{end}}
## Testing the Author Application Service
Finally, we can write some tests for the `IAuthorAppService`. Add a new class, named `AuthorAppService_Tests` in the `Authors` namespace (folder) of the `Acme.BookStore.Application.Tests` project:
"'{0}' and '{1}' do not match.":"'{0}' and '{1}' do not match.",
"The {0} field is not a valid credit card number.":"The {0} field is not a valid credit card number.",
"{0} is not valid.":"{0} is not valid.",
"The {0} field is not a valid e-mail address.":"The {0} field is not a valid e-mail address.",
"The {0} field only accepts files with the following extensions: {1}":"The {0} field only accepts files with the following extensions: {1}",
"The field {0} must be a string or array type with a maximum length of '{1}'.":"The field {0} must be a string or array type with a maximum length of '{1}'.",
"The field {0} must be a string or array type with a minimum length of '{1}'.":"The field {0} must be a string or array type with a minimum length of '{1}'.",
"The {0} field is not a valid phone number.":"The {0} field is not a valid phone number.",
"The field {0} must be between {1} and {2}.":"The field {0} must be between {1} and {2}.",
"The field {0} must match the regular expression '{1}'.":"The field {0} must match the regular expression '{1}'.",
"The {0} field is required.":"The {0} field is required.",
"The field {0} must be a string with a maximum length of {1}.":"The field {0} must be a string with a maximum length of {1}.",
"The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.":"The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.",
"The {0} field is not a valid fully-qualified http, https, or ftp URL.":"The {0} field is not a valid fully-qualified http, https, or ftp URL.",
"The field {0} is invalid.":"The field {0} is invalid.",
"ThisFieldIsNotAValidCreditCardNumber.":"This field is not a valid credit card number.",
"ThisFieldIsNotValid.":"This field is not valid.",
"ThisFieldIsNotAValidEmailAddress.":"This field is not a valid e-mail address.",
"ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}":"This field only accepts files with the following extensions: {0}",
"ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthoOf{0}":"This field must be a string or array type with a maximum length of '{0}'.",
"ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}":"This field must be a string or array type with a minimum length of '{0}'.",
"ThisFieldIsNotAValidPhoneNumber.":"This field is not a valid phone number.",
"ThisFieldMustBeBetween{0}And{1}":"This field must be between {0} and {1}.",
"ThisFieldMustMatchTheRegularExpression{0}":"This field must match the regular expression '{0}'.",
"ThisFieldIsRequired.":"This field is required.",
"ThisFieldMustBeAStringWithAMaximumLengthOf{0}":"This field must be a string with a maximum length of {0}.",
"ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}":"This field must be a string with a minimum length of {1} and a maximum length of {0}.",
"ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl":"This field is not a valid fully-qualified http, https, or ftp URL.",
"ThisFieldIsInvalid.":"This field is invalid."
"'{0}' and '{1}' do not match.":"'{0}' و '{1}' غير متطابقان",
"The {0} field is not a valid credit card number.":"الحقل {0} لا يمثل رقم بطاقة ائتمان صالح.",
"{0} is not valid.":"{0} غير صالح.",
"The {0} field is not a valid e-mail address.":"الحقل {0} لا يمثل عنوان بريد إلكتروني صالح.",
"The {0} field only accepts files with the following extensions: {1}":"الحقل {0} يقبل الملفات ذات الامتدادات التالية فقط: {1}",
"The field {0} must be a string or array type with a maximum length of '{1}'.":"يجب أن يكون الحقل {0} عبارة عن سلسلة أو صفيف طوله '{1}' كحد أقصى.",
"The field {0} must be a string or array type with a minimum length of '{1}'.":"يجب أن يكون الحقل {0} عبارة عن سلسلة أو صفيف طوله كحد أدنى '{1}'.",
"The {0} field is not a valid phone number.":"الحقل {0} لا يمثل رقم هاتف صالح.",
"The field {0} must be between {1} and {2}.":"يجب أن يكون الحقل {0} بين {1} و {2}.",
"The field {0} must match the regular expression '{1}'.":"يجب أن يتطابق الحقل {0} مع التعبير النمطي '{1}'.",
"The {0} field is required.":"الحقل {0} إجباري.",
"The field {0} must be a string with a maximum length of {1}.":"يجب أن يكون الحقل {0} سلسلة أحرف طولها كحد أقصى {1}.",
"The field {0} must be a string with a minimum length of {2} and a maximum length of {1}.":"يجب أن يكون الحقل {0} سلسلة أحرف طولها {1} كحد أدنى و {2} كحد أقصى.",
"The {0} field is not a valid fully-qualified http, https, or ftp URL.":"الحقل {0} ليس عنوانا URL صالحًا مؤهلاً بالكامل سواء كان عنوان http أو https أو ftp",
"The field {0} is invalid.":"الحقل {0} غير صالح.",
"ThisFieldIsNotAValidCreditCardNumber.":"هذا الحقل لا يمثل رقم بطاقة ائتمان صالح.",
"ThisFieldIsNotValid.":"هذا الحقل غير صالح.",
"ThisFieldIsNotAValidEmailAddress.":"هذا الحقل لا يمثل عنوان بريد إلكتروني صالح.",
"ThisFieldOnlyAcceptsFilesWithTheFollowingExtensions:{0}":"هذا الحقل يقبل الملفات ذات الامتدادات التالية فقط: {0}",
"ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}":"هذا الحقل يجب أن يكون سلسلة أحرف أو صفيف لا يتعدى طوله '{0}'.",
"ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}":" هذا الحقل يجب أن يكون عبارة عن سلسلة أو صفيف طوله كحد أدنى '{0}'.",
"ThisFieldIsNotAValidPhoneNumber.":"هذا الحقل لا يمثل رقم هاتف صالح.",
"ThisFieldMustBeBetween{0}And{1}":"هذا الحقل يجب أن يكون بين {0} و {1}.",
"ThisFieldMustMatchTheRegularExpression{0}":"هذا الحقل يجب أن يتطابق مع التعبير النمطي '{0}'.",
"ThisFieldIsRequired.":"هذا الحقل إجباري.",
"ThisFieldMustBeAStringWithAMaximumLengthOf{0}":"هذا الحقل يجب أن يكون سلسلة أحرف طولها كحد أقصى {0}.",
"ThisFieldMustBeAStringWithAMinimumLengthOf{1}AndAMaximumLengthOf{0}":"هذا الحقل يجب أن يكون سلسلة أحرف طولها {0} كحد أدنى و {1} كحد أقصى.",
"ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl":"هذا الحقل ليس عنوانا URL صالحًا مؤهلاً بالكامل سواء كان عنوان http أو https أو ftp",