User authentication is a fundamental part of any meaningful application. Unfortunately, implementing it properly can be a painful exercise that steals time and energy away from more meaningful features of our application. In this post, we'll learn st…
最近使用docker对项目进行了改进,把步骤记录一下,顺便说明一下项目的结构. 项目是前后端分离的项目,后端使用asp.net core 2.2,采用ddd+cqrs架构的分层思想,前端使用的是angular,数据库采用了sqlserver.所有的部件都是由docker部署到服务器上. 后端 后端的整体结构如下: Application层是应用层,主要解耦api层(展现层)和领域层,提供dto和应用服务接口等内容,它主要用来描述客户用例. Core层是领域核心层,这里定义了实体.Command.…
基本思路是调用登录接口,获取token,使用token请求其他JWT接口: getHomeDetails(): Observable<HomeDetails> { let headers = new Headers(); headers.append('Content-Type', 'application/json'); let authToken = localStorage.getItem('auth_token'); headers.append('Authorization', `B…
1. dotnet ef相关命令 删除数据库(适合只有一个数据库的情形) dotnet ef database drop --force 更新数据库(适合只有一个数据库的情形) dotnet ef database update 如果多个数据库,则需更改: 首先,查看有哪些数据库context: dotnet ef dbcontext list > dotnet ef dbcontext list info: Microsoft.AspNetCore.DataProtection.KeyMana…
我希望你们都知道Angular 5已经发布了.在本文中,我们将看到如何使用Angular5TemplateCore开始使用Angular 5和ASP.NET Core. 使用Angular5TemplateCore开发一个适用于ASP.NET Core的Angular 5应用程序非常简单和容易.我们来详细看看 先决条件 确保您已经在计算机上安装了所有先决条件.如果没有,那么下载并安装所有,一个一个. 首先,从这个链接下载并安装Visual Studio 2017 . 下载并安装.NET Core…
Most of the literature concerning the theme of authentication in ASP.NET Core focuses on the use of the ASP.NET Identity framework. In that context, things don’t seem to have changed much or, more precisely, all the changes that occurred in the infra…
Upgrading to .NET Core 2.0 Preview 1 更新 依赖的类库 改为 标准库 2 web app  更改 csproj 文件---升级版本 <PropertyGroup> <TargetFramework>netcoreapp2.0</TargetFramework>   </PropertyGroup>   <ItemGroup> <PackageReference Include="Microsof…
本文转自:http://andrewlock.net/an-introduction-to-oauth-2-using-facebook-in-asp-net-core/ This is the next post in a series on authentication and authorisation in ASP.NET Core. In this post I look in moderate depth at the OAuth 2.0 protocol as it pertain…
注:本文提到的代码示例下载地址> How to achieve a bearer token authentication and authorization in ASP.NET Core 在ASP.NET Core中实现一个Token base的身份认证 以前在web端的身份认证都是基于Cookie | Session的身份认证, 在没有更多的终端出现之前,这样做也没有什么问题,但在Web API时代,你所需要面对的就不止是浏览器了,还有各种客户端,这样就有了一个问题,这些客户端是不知道co…
鸡冻人心的2016,微软高产年. build 2016后 各种干货层出不穷. 1 Win10 集成了bash  ,实现了纳德拉的成诺,Microsoft Love Linux!!! 2 跨平台  ,收购Xamarin ..还给开源了 3 Sqlserver有了Linux的版本............... 4 ASP.NET 5迎来第一个稳定版本,跨平台.在Windows Linux Mac OsX 中都能玩了......... 光说不练假把式,先上图一枚.... ---------------…