From f839ea91bb54a523dd9ec98e03007e85f108bd74 Mon Sep 17 00:00:00 2001 From: KIM BYEONG JU <100591433+hagisilm@users.noreply.github.com> Date: Tue, 28 May 2024 22:42:29 +0900 Subject: [PATCH] add: Korean readme translation --- README.ko.md | 172 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 171 insertions(+), 1 deletion(-) diff --git a/README.ko.md b/README.ko.md index 672ba60..5930002 100644 --- a/README.ko.md +++ b/README.ko.md @@ -1 +1,171 @@ -Waiting contributions ๐Ÿ™Œ +
+

NuGet +star GitHub stars version +

+
+ +--- + +
+

+ English | ็ฎ€ไฝ“ไธญๆ–‡ | ็น้ซ”ไธญๆ–‡ | ๆ—ฅๆœฌ่ชž | ํ•œ๊ตญ์–ด | Espaรฑol +

+
+ + + +--- + +
+ ๋„ˆ์˜ Star, Donate, Recomm. ๊ฐ€ MiniAuth๋ฅผ ๋” ์ข‹๊ฒŒ ๋งŒ๋“ค ์ˆ˜ ์žˆ์–ด! +
+ + + + + +### ์†Œ๊ฐœ + +"ํ•œ ์ค„ ์ฝ”๋“œ"๋Š” ์‹ /๊ตฌ ํ”„๋กœ์ ํŠธ์— ๋Œ€ํ•œ ์‹ ์› ๊ด€๋ฆฌ ์›น์„ ์ถ”๊ฐ€ํ•ฉ๋‹ˆ๋‹ค. + + + + + + + + + + +
Image 1Image 2
Image 3Image 4
+ + +### ํŠน์ง• + +- ํ˜ธํ™˜์„ฑ: .NET Identity ํ‘œ์ค€์„ ๋”ฐ๋ฅด๋Š” JWT, Cookie ๋ฐ Session์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. +- ์ฆ‰์‹œ ์‚ฌ์šฉ ๊ฐ€๋Šฅ: ์†์‰ฌ์šด ํ†ตํ•ฉ, MiniAuth๋Š” API, MVC, Razer Pages์™€ ํ•จ๊ป˜ ์ž‘๋™ํ•ฉ๋‹ˆ๋‹ค. +- ๋ฉ€ํ‹ฐ ํ”Œ๋žซํผ: ๋ฆฌ๋ˆ…์Šค, macOS ํ™˜๊ฒฝ์„ ์ง€์›ํ•ฉ๋‹ˆ๋‹ค. +- ๋‹ค์ค‘ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ง€์›: Identity EF Core ํ‘œ์ค€์„ ๋”ฐ๋ฅด๋Š” ๋ชจ๋“  ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค์™€ ํ˜ธํ™˜๋ฉ๋‹ˆ๋‹ค. + +### ์„ค์น˜ + +ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•˜์„ธ์š” [NuGet](https://www.nuget.org/packages/MiniAuth): + +``` +dotnet add package MiniAuth +// or +NuGet\Install-Package MiniAuth +``` + +### ๋น ๋ฅธ ์‹œ + +ํ•œ์ค„์˜ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ด๋ผ `services.AddMiniAuth()` Startup์—, ๊ทธ๋ฆฌ๊ณ ๋‚˜์„œ ํ”„๋กœ์ ํŠธ๋ฅผ ์‹คํ–‰ํ•ด ์˜ˆ: + +```csharp +public class Program +{ + public static void Main(string[] args) + { + var builder = WebApplication.CreateBuilder(args); + + builder.Services.AddMiniAuth(); + + var app = builder.Build(); + app.Run(); + } +} +``` + +๊ธฐ๋ณธ ๊ด€๋ฆฌ์ž ๊ณ„์ •์€ `admin@mini-software.github.io` ์ด๋ฉฐ ๋น„๋ฐ€๋ฒˆํ˜ธ๋Š” `E7c4f679-f379-42bf-b547-684d456bc37f`(๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ remember)์ž…๋‹ˆ๋‹ค. ๊ด€๋ฆฌ์ž ํŽ˜์ด์ง€๋Š” `http(s)://yourhost/miniauth/index.html`์—์„œ ์ ‘์†ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + +์ฐธ๊ณ : ์ด๋ฏธ ๋ณธ์ธ ์ธ์ฆ์ด ์žˆ๋Š” ๊ฒฝ์šฐ ์•„๋ž˜ ์ง€์นจ์„ ๋”ฐ๋ฅด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค. + +### ๊ธฐ์กด Identity Setup + +`Add MiniAuth`์— ๋Œ€ํ•ด autoUse๋ฅผ ํ•ด์ œํ•˜๊ณ  Use MiniAuth์—์„œ ์ปจํ…์ŠคํŠธ, ์‚ฌ์šฉ์ž ๋ฐ ์‚ฌ์šฉ ๊ถŒํ•œ ์ธ์ฆ์œผ๋กœ ๊ต์ฒดํ•˜์—ฌ ์ž์‹ ์˜ ์ธ์ฆ ๋’ค์— ๋ฐฐ์น˜ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ: +```csharp +public static void Main(string[] args) +{ + var builder = WebApplication.CreateBuilder(args); + + var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found."); + builder.Services.AddDbContext(options => + options.UseSqlServer(connectionString)); + builder.Services.AddDatabaseDeveloperPageExceptionFilter(); + + builder.Services.AddDefaultIdentity(options => options.SignIn.RequireConfirmedAccount = true) + .AddRoles() + .AddEntityFrameworkStores(); + + builder.Services.AddControllersWithViews(); + + builder.Services.AddMiniAuth(autoUse: false); // <= โ—โ—โ— + + var app = builder.Build(); + + app.UseMiniAuth(); // <= โ—โ—โ— + app.MapControllerRoute( + name: "default", + pattern: "{controller=Home}/{action=Index}/{id?}"); + app.MapRazorPages(); + + app.Run(); +} +``` + +#### ์ฃผ๋ฌธ ์‚ฌํ•ญ +Use MiniAuth๋ฅผ ๋ผ์šฐํŒ… ์ƒ์„ฑ ํ›„์— ๋ฐฐ์น˜ํ•˜์‹ญ์‹œ์˜ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ์‹œ์Šคํ…œ์ด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๊ถŒํ•œ ๊ฒ€์‚ฌ๋ฅผ ์œ„ํ•œ ๋ผ์šฐํŒ… ๋ฐ์ดํ„ฐ๋ฅผ ์–ป์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค: + +```csharp +app.UseRouting(); +app.UseMiniAuth(); +``` + +#### ์ฐธ๊ณ : ์—ญํ•  ๊ทœ์น™ ์ถ”๊ฐ€ + +`AddRoles()`; ์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š” ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด `[Authorize(Roles = "YourRole")]`๊ฐ€ ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. +```C# +builder.Services.AddDefaultIdentity(options => options.SignIn.RequireConfirmedAccount = true) + .AddRoles() // โ—โ—โ— + .AddEntityFrameworkStores(); +``` + +#### MiniAuth ๋กœ๊ทธ์ธ ์‚ฌ์šฉ ์•ˆ ํ•จ +์ž์‹ ๋งŒ์˜ ๋กœ๊ทธ์ธ ๋กœ์ง, ํŽ˜์ด์ง€, API๋งŒ ์‚ฌ์šฉํ•˜๊ณ  ์‹ถ๋‹ค๋ฉด ๋กœ๊ทธ์ธ ๊ฒฝ๋กœ๋ฅผ ์ปค์Šคํ„ฐ๋งˆ์ด์ง•ํ•˜๊ณ  ์Šค์œ„์น˜๋ฅผ ๋Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +```C# +// before add service +MiniAuthOptions.LoginPath = "/Identity/Account/Login"; +MiniAuthOptions.DisableMiniAuthLogin = true; +``` + +### ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ณ€๊ฒฝ + +MiniAuth ์‹œ์Šคํ…œ์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ฝ”๋“œ ์„ค์ • ์—†์ด SQLite๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ „ํ™˜์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ `app.Use MiniAuth`์—์„œ ๋‹ค๋ฅธ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์œ ํ˜•์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. + +### ๊ตฌ์„ฑ ๋ฐ ์˜ต์…˜ + +#### ๊ธฐ๋ณธ ๋ชจ๋“œ + +- MiniAuth๋Š” ๋“ฑ๋ก ๋ฐ ์•”ํ˜ธ ์žฌ์„ค์ •๊ณผ ๊ฐ™์€ ์‚ฌ์šฉ์ž ์ž‘์—…์„ IT ๊ด€๋ฆฌ์ž๊ฐ€ ์ค‘์•™์—์„œ ๊ด€๋ฆฌํ•˜๋Š” ๊ธฐ๋ณธ ๋ชจ๋“œ๋กœ ์ž‘๋™ํ•˜๋ฏ€๋กœ ์ด๋Ÿฌํ•œ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•˜๋ ค๋ฉด ๊ด€๋ฆฌ์ž ๊ถŒํ•œ ๊ณ„์ •์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. Default Role = miniauth-admin. + +#### ๋กœ๊ทธ์ธ ๋ฐ ์‚ฌ์šฉ์ž ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ + +ApiController๊ฐ€ ์•„๋‹Œ ๊ฒฝ์šฐ ๋กœ๊ทธ์ธ์€ login.html ํŽ˜์ด์ง€(Headers["X-Requested-With"] == "XMLHtpRequest" ๋˜๋Š” ApiControllerAttribute๋กœ ๋ฆฌ๋””๋ ‰์…˜๋ฉ๋‹ˆ๋‹ค. +ApiController๋Š” ๊ธฐ๋ณธ์ ์œผ๋กœ ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€๋กœ ๋ฆฌ๋””๋ ‰์…˜ํ•˜์ง€ ์•Š๊ณ  401 ์ƒํƒœ ์ฝ”๋“œ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค. + +### ๋ถ„์‚ฐ ์‹œ์Šคํ…œ + +- ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์†Œ์Šค๋ฅผ SQL Server, MySQL, PostgreSQL ๋“ฑ์œผ๋กœ ์ „ํ™˜ํ•ด์ฃผ์„ธ์š”. + +### ์‚ฌ์šฉ์ž ์ •์˜ ํ”„๋ก ํŠธ์—”๋“œ + +- ๊ด€๋ฆฌ ๋ฐฑ์—”๋“œ ํ”„๋ก ํŠธ์—”๋“œ๋Š” `/src/Frontend_Identity`์—์„œ Vue3 + Vite๋ฅผ ์‚ฌ์šฉํ•˜๋ฉฐ, `npm run build`๋ฅผ ์‚ฌ์šฉํ•œ ํ›„ miniauth UI๋ฅผ ์—…๋ฐ์ดํŠธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. +- ๋กœ๊ทธ์ธ ํŽ˜์ด์ง€์— miniauth ๊ธฐ๋ณธ๊ฐ’์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š์œผ๋ ค๋ฉด mvc์—์„œ ID ์Šค์บํด๋“œ Login.cshtml์„ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ miniauth ํ”„๋ก ํŠธ์—”๋“œ์˜ login.html, js, css๋ฅผ ๋ณ€๊ฒฝํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. + +### ๋ฆด๋ฆฌ์Šค ๋…ธํŠธ + +์—…๋ฐ์ดํŠธ ๋‚ด์šฉ์€ [Release Notes](releases)๋ฅผ ์ฐธ๊ณ ํ•˜์„ธ์š”. + +### TODO + +Link: [MiniAuth.Identify project](https://github.com/orgs/mini-software/projects/7/views/1) \ No newline at end of file