GithubHelp home page GithubHelp logo

damienbod / identityserver4aspnetcoreidentitytemplate Goto Github PK

View Code? Open in Web Editor NEW
328.0 28.0 64.0 6.15 MB

An ASP.NET Core 6.0 IdentityServer4 Identity Bootstrap 4 template with localization

Home Page: https://www.nuget.org/packages/IdentityServer4AspNetCoreIdentityTemplate/

License: MIT License

C# 44.27% JavaScript 4.90% CSS 31.71% HTML 19.11%
identityserver4 identity sts aspnet-core mvc bootstrap4 localization 2fa aspnetcore nuget

identityserver4aspnetcoreidentitytemplate's Introduction

An ASP.NET Core IdentityServer4 Identity Template with Bootstrap 4 and Localization

.NET NuGet Status Change log

Features

  • ASP.NET Core 6
  • Latest ASP.NET Core Identity
  • Bootstrap 4 UI
  • Localization en-US, de-DE, it-IT, fr-FR, zh-Hans, es-MX, de-CH, ga-IE, gsw-CH
  • 2FA
  • TOTP
  • FIDO2 MFA
  • Personal data, download, delete (part of Identity)
  • Azure AD, Cert, key vault deployments API
  • SendGrid Email API
  • npm with bundleconfig used for frontend packages
  • EF Core
  • Support for ui_locales using OIDC logins

some print screens:

it-IT

it-IT

de-DE

de-DE

en-US

en-US

fr-FR

fr-FR

zh-Hans

zh-Hans

Using the template

install

From NuGet:

dotnet new -i IdentityServer4AspNetCoreIdentityTemplate

Locally built nupkg:

dotnet new -i IdentityServer4AspNetCoreIdentityTemplate.6.0.1.nupkg

Local folder:

dotnet new -i <PATH>

Where <PATH> is the path to the folder containing .template.config.

run

dotnet new sts -n YourCompany.Sts

Use the -n or --name parameter to change the name of the output created. This string is also used to substitute the namespace name in the .cs file for the project.

Setup, Using the application for your System

  • Change the EF Core code from SQLite to your required database
  • Change the ApplicationUser class as required, remove/add the properties
  • Add the migrations and create the database
  • Define the deployment URLs, create the certs, and use these in your application (Startup, config files)
  • Add the external providers for login as required, or remove
  • Remove the UI views which are not required
  • Add remove the resource file localizations and also in the Startup.
  • Add the client configuration to the Config.cs class (dev, test, staging, prod, or whatever)
  • Update the claims in the IdentityWithAdditionalClaimsProfileService
  • Add the security headers as required, CSP, IFrame, XSS, HSTS, ...
  • If you deploy in a multi instance environment, add the session data to a database using the IdentityServer4.EntityFramework NuGet package
  • Add "AZURE_TENANT_ID": "your-tenandId" to the launch settings to test in VS with Azure Key Vault certificates

uninstall

dotnet new -u IdentityServer4AspNetCoreIdentityTemplate

Development

build

https://docs.microsoft.com/en-us/dotnet/core/tutorials/create-custom-template

nuget pack content/IdentityServer4AspNetCoreIdentityTemplate.nuspec

dotnet Migrations

open the cmd in project folder:

dotnet restore

dotnet ef migrations add sts_init --context ApplicationDbContext --verbose

dotnet ef database update  --verbose

Using Powershell to create the self signed certs:

New-SelfSignedCertificate -DnsName "sts.dev.cert.com", "sts.dev.cert.com" -CertStoreLocation "cert:\LocalMachine\My"

$mypwd = ConvertTo-SecureString -String "1234" -Force -AsPlainText

Get-ChildItem -Path cert:\localMachine\my\"The thumbprint..." | Export-PfxCertificate -FilePath C:\git\sts_dev_cert.pfx -Password $mypwd

Credits, Used NuGet packages + ASP.NET Core 3.1 standard packages

  • IdentityServer4
  • IdentityServer4.AspNetIdentity
  • Azure.Security.KeyVault.Secrets
  • Microsoft.IdentityModel.Clients.ActiveDirectory
  • Sendgrid
  • NetEscapades.AspNetCore.SecurityHeaders
  • Serilog

Links

http://docs.identityserver.io/en/release/

https://github.com/IdentityServer/IdentityServer4

https://getbootstrap.com/

https://nodejs.org/en/

https://www.npmjs.com/

identityserver4aspnetcoreidentitytemplate's People

Contributors

alekseyaz avatar asadsahi avatar bbrandt avatar capsurlamer avatar damienbod avatar danielmarbach avatar dependabot[bot] avatar fanruinet avatar franklin89 avatar jahbenjah avatar kasuken avatar kdaveid avatar manuelmeyer1 avatar robertmuehsig avatar skulblaka avatar tcfox avatar wellspringcs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

identityserver4aspnetcoreidentitytemplate's Issues

Verifyemail sends resetpassword link

Accountcontroller.cs -> SendVerificationEmail(...)

var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);

Should be:
var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme);

Encode PasswordResetToken and EmailConfirmationToken to base64URL

Improve cert handling for Azure deployments

@Eneuman Would you be interested in adding your code here?

Saw this issue: SigningKey Azure Key Vault Provider

I have some helpers for this, maybe your solution is better. I use this as a template or quick starter for creating STS servers, which can be deployed easily to Azure App Services or IIS

Greetings Damien

Add OpenLDAP support

It would be awesome if OpenLDAP support is added to the Repo. There are already other projects out there (e.g. https://github.com/Nordes/IdentityServer4.LdapExtension or https://github.com/jusbuc2k/Justin.AspNetCore.LdapAuthentication) which did some work on that topic.

Example config settings

    "BindDn": "cn=adminuser,dc=damienbod,dc=com",
    "BindCredentials": "P@ss1W0Rd!",
    "SearchBase": "ou=users,DC=damienbod,dc=com",
    "SearchFilter": "(&(objectClass=person)(cn={0}))"

Advantages

  • The Project would serve an IdP with MFA support and LDAP Integration
  • Usage of existing UserStores via LDAP
  • Usage of On-Premises OpenLDAP instead of AzureAD

External login

How to add the external login with google, twitter, facebook, etc.?

Provide DB Dump and sample Migration Files

Adding the migrations from ConfigurationDbContext and PersistedGrantDbContext for sqlServer worked smoothly. Unfortunately, I keep encountering errors when adding the ApplicationDbContext migrations. Therefore it would be extremely helpful to have a sample database dump and see for example migrations under / Data / Migrations.

"damienbodserver.pfx"

I'm not 100% sure if the naming is a cool ad for your name, but maybe the dev certificate should be renamed to something neutral for this kind of template ;)

Missing zh-Hans translations Grants , Enable MFA Error

GRANTS
Grants

GRANTS_API_GRANTS
API Grants

GRANTS_CLIENT_APP_ACCESS
Client Application Access

GRANTS_CREATED
Created

GRANTS_EXPIRES
Expires

GRANTS_IDENTITY_GRANTS
Identity Grants

GRANTS_INFO
Below is the list of applications you have given access to and the names of the resources they have access to.

GRANTS_NO_ACCESS
You have not given access to any applications

GRANTS_REVOKE_ACCESS
Revoke Access

ERROR_ENABLE_MFA
Enable MFA

ERROR_ENABLE_MFA_CLIENT_APP_REQUIRES_MFA
The client application requires you to have MFA enabled. Enable this and try to sign in again.

ERROR_ENABLE_MFA_ERROR_TITLE
Enable MFA Error

ERROR_ENABLE_MFA_YOU_CAN_ENABLE_HERE
You can enable MFA to login here:

Missing translations in All languages

"Access to your applications and resources, even when you are offline"

"Invalid selection"

"Offline Access"

"You must pick at least one permission"

"Recovery codes"

"CONSENT_CONFIRM_AUTH_REQUEST_QUOTES" en-US = Please confirm that the authorization request quotes the code:

"DEVICE_USER_CODE" en-US = User Code

"DEVICE_ENTER_CODE_DISPLAYED_ON_DEVICE" en-US = Please enter the code displayed on your device

"DEVICE_SUCCESS_AUTHORIZE" en-US = You have successfully authorized the device

"DEVICE_SUCCESS" en-US = Success

"Your user identifier"

"User profile"

"Your user profile information (first name, last name, etc.)"

"Your email address"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.