인증서버 7

IdentityServer 학습 #10 - BFF without backend

본문 글은 원문(https://docs.duendesoftware.com/identityserver/v7/quickstarts/js_clients/js_without_backend/)을 참고하여 작성되었습니다. (1) 먼저 사용할 프로젝트를 생성해 줍니다. (예시에서는 SPA) dotnet new web -n SPA (2) 해당 프로젝트를 솔루션에 추가해 줍니다. dotnet sln add ./{프로젝트경로} (3) wwwroot 디렉토리를 만들어 주고, package.json 파일을 생성해 줍니다. npm init (4) oidc-client 라이브러리를 설치해 줍니다. (시작파일은 app.js로 지정) npm i oidc-client (5) 설치된 라이브러리에 있는 js 파일을 wwwroot 로 복사..

IdentityServer 학습 #8 - EntityframeworkCore

그 동안에는 AddInMemoryClients 등을 이용해서 코드에서 직접 정의되었던 것을 DB를 이용한 형태로 변경합니다. 본문의 원문은 다음 링크를 참고합니다. 원문링크 : https://docs.duendesoftware.com/identityserver/v7/quickstarts/4_ef/ Duende Software Documentation The most flexible and standards-compliant OpenID Connect and OAuth 2.0 framework for ASP.NET Core. docs.duendesoftware.com 더불어 원문에서는 Database로 Sqlite를 사용했으나, 본문에서는 Sql Server로 변경하였습니다. (1) 먼저 기존에 설치된 I..

IdentityServer 학습 #7 - API access

API access 관련 내용을 다음과 같이 정리합니다. 원문링크 : https://docs.duendesoftware.com/identityserver/v7/quickstarts/3_api_access/ (1) 새롭게 추가할 스코프를 정의해 줍니다. (중요! 원문에서 누락된 부분) public static IEnumerable IdentityResources => new IdentityResource[] { new IdentityResources.OpenId(), new IdentityResources.Profile(), new IdentityResource() { Name = "verification", UserClaims = new List { JwtClaimTypes.Email, JwtClaimT..

IdentityServer 학습 #6 - OpenID Connect

이제부터는 OpenID Connect를 학습해 봅시다. (1) 먼저 OpenID Connect를 위한 UI를 IdentityServer에 추가해 줍니다. dotnet new isui (2) 주석 처리되어 있던 Razor 관련 항목들을 활성화 시켜 줍니다. using Serilog; namespace IdentityServer; internal static class HostingExtensions { public static WebApplication ConfigureServices(this WebApplicationBuilder builder) { // uncomment if you want to add a UI builder.Services.AddRazorPages(); builder.Services..

IdentityServer 학습 #3

(1) 콘솔 응용프로그램을 추가해 줍니다. dotnet new console -n {프로젝트명} (2) 해당 프로젝트를 솔루션에 추가해 줍니다. dotnet sln add ./{프로젝트폴더} (3) 해당 프로젝트에 IdentityModel을 Nuget으로 설치해 줍니다. dotnet add ./{프로젝트폴더} package IdentityModel (4) 개발용 인증서를 신뢰하기 위해 다음 명령을 수행합니다. dotnet dev-certs https --trust (5) 콘솔 응용프로그램의 Program.cs의 내용을 다음 내용으로 변경합니다. using IdentityModel.Client; using System.Text.Json; // discover endpoints from metadata va..

IdentityServer 학습 #2

(1) IdentityServer가 추가되어있는 솔루션에 새로운 API 프로젝트를 추가해 줍니다. dotent new webapi -n {프로젝트명} --no-openapi (2) 해당 프로젝트를 솔루션에 추가해 줍니다. dotnet sln add ./src/{프로젝트폴더} (3) Microsoft.AspNetCore.Authentication.JwtBearer 라이브러리를 Nuget에서 설치해 줍니다. dotnet add ./{프로젝트폴더} package Microsoft.AspNetCore.Authentication.JwtBearer (4) 추가한 프로젝트의 Program.cs 를 다음과 같이 수정합니다. using System.Security.Claims; var builder = WebApplic..

IdentityServer 학습 #1 - 기본셋팅

본 내용은 다음 원문을 정리한 글입니다. 원문링크 : https://docs.duendesoftware.com/identityserver/v7/quickstarts/1_client_credentials/ 예제 프로젝트 생성 순서 * 본문의 작성 기준은 .net8을 기준으로 작성되었습니다. (1) 다음 명령으로 Duende.IdentityServer.Templates를 설치해 줍니다. dotnet new install Duende.IdentityServer.Templates (2) 빈 솔루션 하나를 생성해 줍니다. dotnet new sln -n {솔루션명칭} (3) 빈 IdentityServer 템플릿을 추가합니다. dotnet new isempty -n IdentityServer (4) 솔루션에 프로젝..

반응형