|
| 1 | +# IdWeb Guidelines |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Microsoft Identity Web is a comprehensive authentication and authorization library for ASP.NET Core, OWIN web apps and web APIs, and daemon apps that integrate with the Microsoft identity platform and CIAM or AzureAD B2C. The library provides essential functionality for: |
| 6 | + |
| 7 | +- Web applications that sign in users and optionally call web APIs |
| 8 | +- Protected web APIs that may call downstream web APIs |
| 9 | +- Daemon applications calling downstream APIs |
| 10 | +- Token cache implementations |
| 11 | +- Microsoft Graph integration |
| 12 | +- Azure SDK integration |
| 13 | + |
| 14 | +Through its modular architecture and extensive features, Microsoft Identity Web simplifies the implementation of identity and access management in modern web applications while maintaining security best practices. |
| 15 | + |
| 16 | +## Repository Structure |
| 17 | + |
| 18 | +### Core Directories |
| 19 | +- `/src` - Contains all source code for the Microsoft.Identity.Web packages |
| 20 | +- `/tests` - Contains all test projects including unit tests, integration tests and E2E tests |
| 21 | +- `/benchmark` - Performance benchmarking tests |
| 22 | +- `/build` - Build scripts and configuration |
| 23 | +- `/docs` - Documentation and blog posts |
| 24 | +- `/ProjectTemplates` - Project templates for various ASP.NET Core scenarios |
| 25 | +- `/tools` - Development and configuration tools |
| 26 | + |
| 27 | +### Project Templates |
| 28 | +The following templates are provided: |
| 29 | +- Blazor Server Web Applications |
| 30 | +- Blazor WebAssembly Applications |
| 31 | +- Azure Functions |
| 32 | +- Razor Pages Web Applications |
| 33 | +- ASP.NET Core MVC (Starter Web) |
| 34 | +- ASP.NET Core Web API |
| 35 | +- Worker Service |
| 36 | +- Daemon app |
| 37 | + |
| 38 | +## Shipped DLLs/Packages |
| 39 | + |
| 40 | +The following NuGet packages are shipped as part of Microsoft.Identity.Web: |
| 41 | + |
| 42 | +### Core Packages |
| 43 | +- Microsoft.Identity.Web - Core authentication and authorization functionality |
| 44 | +- Microsoft.Identity.Web.UI - UI components and controllers for authentication |
| 45 | +- Microsoft.Identity.Web.TokenCache - Token cache implementations |
| 46 | +- Microsoft.Identity.Web.TokenAcquisition - Token acquisition functionality |
| 47 | +- Microsoft.Identity.Web.Certificate - Certificate management and loading |
| 48 | +- Microsoft.Identity.Web.Certificateless - Support for certificateless authentication |
| 49 | + |
| 50 | +### Integration Packages |
| 51 | +- Microsoft.Identity.Web.Azure - Azure SDK integration support |
| 52 | +- Microsoft.Identity.Web.DownstreamApi - Support for calling downstream APIs |
| 53 | +- Microsoft.Identity.Web.OWIN - OWIN middleware integration |
| 54 | + |
| 55 | +### Microsoft Graph Packages |
| 56 | +- Microsoft.Identity.Web.MicrosoftGraph - Microsoft Graph integration |
| 57 | +- Microsoft.Identity.Web.MicrosoftGraphBeta - Microsoft Graph Beta API integration |
| 58 | +- Microsoft.Identity.Web.GraphServiceClient - Graph SDK integration |
| 59 | +- Microsoft.Identity.Web.GraphServiceClientBeta - Graph Beta SDK integration |
| 60 | + |
| 61 | +### Additional Functionality |
| 62 | +- Microsoft.Identity.Web.Diagnostics - Diagnostic and logging support |
| 63 | +- Microsoft.Identity.Web.OidcFIC - OpenID Connect Federated Identity Credential support |
| 64 | + |
| 65 | +## Development Guidelines |
| 66 | + |
| 67 | +### Common Development Patterns |
| 68 | +- Follow .editorconfig rules strictly |
| 69 | +- Ensure proper error handling |
| 70 | +- Maintain test coverage for changes |
| 71 | +- Document API changes thoroughly |
| 72 | +- Keep configuration consistent with project standards |
| 73 | + |
| 74 | +### Testing Requirements |
| 75 | +- Include tests for all code changes |
| 76 | +- Follow existing test patterns |
| 77 | +- Include benchmark tests for performance-sensitive changes |
| 78 | +- Verify security implications of changes |
| 79 | + |
| 80 | +### Public API Changes |
| 81 | +- The project uses Microsoft.CodeAnalysis.PublicApiAnalyzers (version 3.3.4) to track changes to public APIs |
| 82 | +- For any changes to public APIs (classes, interfaces, methods, properties, etc.), you must: |
| 83 | + 1. Locate the PublicAPI.Unshipped.txt file in the directory of the changed code |
| 84 | + 2. Include the complete API signature |
| 85 | + |
| 86 | +Example format: |
| 87 | +```diff |
| 88 | +// Adding new API |
| 89 | ++MyNamespace.MyClass.MyNewMethod() -> void |
| 90 | ++MyNamespace.MyClass.MyProperty.get -> string |
| 91 | ++MyNamespace.MyClass.MyProperty.set -> void |
| 92 | + |
| 93 | +// Removing API |
| 94 | +-MyNamespace.MyClass.OldMethod() -> void |
| 95 | +``` |
| 96 | + |
| 97 | +The analyzer will verify during build that all public API changes are properly documented, and the build will fail if changes are not reflected in PublicAPI.Unshipped.txt. |
0 commit comments