Skip to content

fulfill3d/ProtectedAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProtectedAPI

ProtectedAPI is a secure API service built using Azure Functions and .NET, designed to provide protected endpoints with JWT authentication. It integrates with Azure AD B2C for user authentication and authorization, ensuring secure access to API resources.

Table of Contents

  1. Introduction
  2. Features
  3. Tech Stack
  4. Usage
  5. Configuration

Introduction

ProtectedAPI provides a secure interface for handling requests that require user authentication and authorization. It uses JWT tokens to validate and authorize users, ensuring that only authenticated users can access protected resources.

Features

  • JWT Authentication: Secure endpoints with JSON Web Token (JWT) authentication.
  • Azure AD B2C Integration: Integrates with Azure AD B2C for identity management.
  • Scope-Based Authorization: Authorize users based on predefined scopes.

Tech Stack

  • Backend: .NET 8 (Isolated Worker), Azure Functions v4
  • Authentication: Azure AD B2C, JWT tokens
  • Configuration & Secrets Management: Azure App Configuration, Azure Key Vault
  • Dependency Injection: Used for service registrations and configurations

Usage

  1. Deploy the functions to Azure Functions.
  2. Configure Azure App Configuration and Key Vault with necessary secrets.
  3. Ensure Azure AD B2C is correctly set up and integrated.

Configuration

TokenValidationOptions

  • MetadataUrl: URL to the metadata document used for token validation.
  • ClientId: The client ID for the Azure AD B2C application.
  • Issuer: The expected issuer for the tokens.
public class TokenValidationOptions
{
    public string MetadataUrl { get; set; }
    public string ClientId { get; set; }
    public string Issuer { get; set; }
}

AuthorizationScope

  • TestScope: The scope required for accessing the protected endpoint.
public class AuthorizationScope
{
    public string TestScope { get; set; }
}

About

A JWT-secured Azure Function App in .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages