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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

πŸ‘‹ Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay