Settings
Other configurations available in the bit project templates are as follows:
Authentication policies
bit project templates provide authentication and implement the SignUp and SignIn user interfaces.
You can change the default settings of the Identity Settings according to your needs;
These settings are in the appsettings.json file in the Api project.
"IdentitySettings": { "PasswordRequireDigit": "false", "PasswordRequiredLength": "6", "PasswordRequireNonAlphanumeric": "false", "PasswordRequireUppercase": "false", "PasswordRequireLowercase": "false", "RequireUniqueEmail": "true", "ConfirmationEmailResendDelay": "0.00:02:00", //Format: D.HH:mm:nn "ResetPasswordEmailResendDelay": "0.00:02:00" //Format: D.HH:mm:nn }
JWT settings
bit project templates use JWT to provide token-based authentication and you can change these settings.
You can find these settings in the appsettings.json file in the Api project.
"JwtSettings": { "IdentityCertificatePassword": "P@ssw0rdP@ssw0rd", "Issuer": "TodoTemplate", "Audience": "TodoTemplate", "NotBeforeMinutes": "0", "ExpirationMinutes": "1440" }
Note: IdentityCertificatePassword referring to the password of the
IdentityCertificate.pfx file in the Api project that used as certificate file
for store the public key and etc for validating incoming JWT tokens.
To create PFX file run the following commands in PowerShell with the desired password and file path for your pfx file.
$cert = New-SelfSignedCertificate -CertStoreLocation Cert:\LocalMachine\My -Subject "IdentityServerCN" -Provider "Microsoft Strong Cryptographic Provider" -HashAlgorithm "SHA512" -NotAfter (Get-Date).AddYears(5) Export-PfxCertificate -cert ('Cert:\LocalMachine\My\' + $cert.thumbprint) -FilePath IdentityCertificate.pfx -Password (ConvertTo-SecureString -String "P@ssw0rdP@ssw0rd" -Force -AsPlainText)Note: Replace P@ssw0rdP@ssw0rd with strong password and use that as IdentityCertificatePassword's value in appsettings.json
Email settings
bit project templates use FluentEmail to send emails.
You can change the SMTP provider settings in the appsettings.json file in the Api project.
In dev environment, bit saves the sent emails as a .eml file in the src/Server/Api/bin/Debug/net8.0/sent-emails path, and developers can easily view them in any eml viewer.
You can also use any test smtp server such as ethereal.email or any production ready smtp server such as SendGrid
In dev environment, bit saves the sent emails as a .eml file in the src/Server/Api/bin/Debug/net8.0/sent-emails path, and developers can easily view them in any eml viewer.
You can also use any test smtp server such as ethereal.email or any production ready smtp server such as SendGrid
"EmailSettings": { "Host": "smtp.ethereal.email", "Port": "587", "DefaultFromEmail": "[email protected]", "DefaultFromName": "Alva Schiller", "UserName": "alva.sc[email protected]", "Password": "4PyGY8cDQ8mvu6h7qB" }
Note: You can find email templates used for email confirmation and reset password in the Resources directory of the Api project.
User profile image settings
bit project templates save user profile image in Attachments\Profiles directory
of Environment.SpecialFolder.ApplicationData as default, you can change this path as you need from the appsettings.json file in the Api project.
"UserProfileImagesDir": "Attachments/Profiles/"
Health check settings
bit project templates support Health Checks for reporting the health of app infrastructure components.
Health checks APIs are exposed as an HTTP endpoint. You can change the settings of this feature in the
appsettings.json file in the Api project.
"HealthCheckSettings": { "EnableHealthChecks": true }
Note: You can find Health Checks dashboard from https://localhost:5011/healthchecks-ui by default.