설치
Nuget에서 직접 설치하십시오
다음 명령을 사용하여 Nuget에서 직접 설치할 수 있습니다.
Install-Package IdentityServer4 -Version 4.0.4
IdentityServer4 템플릿을 설치하십시오
dotnet new -i IdentityServer4.Templates
QuickUi 파일 및 ASP.NET ID 추가 (선택 사항)
dotnet new is4aspid --force
아래와 같이 startup.cs의 configureservices () 메소드 업데이트 :
services.AddControllersWithViews();
또한 startup.cs에서 configure () 메소드를 업데이트합니다.
app.UseRouting();
app.UseIdentityServer();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});
프로젝트를 구축하고 실행하십시오 Discovery Endpoint가 UP가 진행되고 있는지 확인하려면“/.well-known/openid-configuration”을 찾아보십시오.
Docker에서 달리기
- 빈 ASP.NET Core 프로젝트 작성 ( ‘Docker 지원 활성화’확인)
- 프로젝트 파일이 Linux OS Linux를 대상으로합니다.
- docker 파일을 다음과 같이 수정하십시오.
FROM microsoft/dotnet:2.2-runtime AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM microsoft/dotnet:2.2-sdk AS build
WORKDIR /src
COPY \[“JrTech.Identity.Web/JrTech.Identity.Web.csproj“, “JrTech.Identity.Web/”\]
RUN dotnet restore “JrTech.Identity.Web/JrTech.Identity.Web.csproj“
COPY . .
WORKDIR “/src/JrTech.Identity.Web”
RUN dotnet build “JrTech.Identity.Web.csproj” -c Release -o /app
FROM build AS publish
RUN dotnet publish “JrTech.Identity.Web.csproj” -c Release -o /app
FROM base AS final
WORKDIR /app
COPY –from=publish /app .
ENTRYPOINT \[“dotnet”, “JrTech.Identity.Web.dll”\]
- 다음 명령을 실행하여 IdentityServer 4 추가 :
dotnet add package IdentityServer4