DEV Community

Wasim Ul Masood
Wasim Ul Masood

Posted on

3 2

Secure Your Rest APIs with Azure Active Directory

Secure Your Rest APIs with Azure Active Directory

ASP.NET Core Web API 3.0 with Azure AD B2 Authentication, Swagger UI.

A sample test web application built in ASP.NET Core 3.0 to perform such tasks as:

  • Authenticate users with Azure AD B2C( Single Sign In with Email, Facebook & Github)
  • Protect Web APIs
  • Redeem authorization code
  • Call a protected Web API from Web Application

Configuration

"Authentication": {
    "Authentication": {
    "AzureAd": {
      "Instance": "",
      "TenantId": "",
      "ClientId": "",
      "ClientSecret": "",
      "PostLogoutRedirectUri": "https://localhost:44397/",
      "ApiIdentifier": "",
      "B2C": {
        "SignInOrSignUpPolicy": "B2C_1_testsignupandsigninpolicy",
        "EditProfilePolicy": "B2C_1_TestProfileEditPolicy",
        "ResetPasswordPolicy": "B2C_1_password-reset"
      }
    }
  },
  "TestServiceOptions": {
    "BaseUrl": "https://localhost:44327/"
  } 
Enter fullscreen mode Exit fullscreen mode

ASP.NET CORE Web API Authentication settings

"Authentication": {
    "Authentication": {
    "AzureAd": {
      "Instance": "",
      "TenantId": "",
      "Audience": "",
      "SignInOrSignUpPolicy": ""
    }
  }
Enter fullscreen mode Exit fullscreen mode

Swagger UI

Web API Swagger UI - https://localhost:44327/swagger
Enter fullscreen mode Exit fullscreen mode

Complete Project: WEB API With Azure AD
`

API Trace View

How I Cut 22.3 Seconds Off an API Call with Sentry 🕒

Struggling with slow API calls? Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay