Skip to content

Latest commit

 

History

History
111 lines (74 loc) · 4.13 KB

File metadata and controls

111 lines (74 loc) · 4.13 KB

Deploy Locally

  1. Get Set up
    1. Prerequisites for Development Environment Setup
    2. Cloning the repo
    3. Installing dependencies
  2. Build Authentication Server Sample
  3. Run Authentication Server Sample
    1. Prerequisites to run the sample
    2. Update the appsettings.json file
    3. Run the App

Get Set up

Prerequisites for Development Environment Setup

Cloning the repo

Clone the repo: https://github.com/Azure-Samples/communication-services-authentication-hero-csharp

# HTTPS
git clone https://github.com/Azure-Samples/communication-services-authentication-hero-csharp.git

# SSH
git clone [email protected]:Azure-Samples/communication-services-authentication-hero-csharp.git

Installing dependencies

Navigate to the project src directory and install dependencies for all packages and samples:

# Navigate to the src directory
cd communication-services-authentication-hero-csharp/src

# restore dependencies
dotnet restore

Note: this may take some time the first time it runs

Build Authentication Server Sample

Once set up, you can run the following commands to build the repo.

# Navigate to the project root directory
cd communication-services-authentication-hero-csharp/

# Builds the project and its dependencies into a set of binaries
dotnet build

Note:

  1. This may take some time the first time it runs.
  2. To learn more dotnet commands, please visit .NET CLI overview
  3. You can also build the repo using Visual Studio:
    1. Right click on the solution ACSAuthenticationSolution.sln in Solution Explorer.
    2. Click on Build Solution

Run Authentication Server Sample

Prerequisites to run the sample

To be able to run this sample locally, you will first need to follow those prerequisites.

Update the appsettings.json File

Before running the sample, you will need to replace the values in the appsettings.json file:

  1. Replace connectionString and scopes for the Communication Services
  2. Replace clientId, tenantId and clientSecret for the Azure Active Directory.

Note: Values of clientId, tenantId and clientSecret are all from your auther-server-sample-webApi. If you created the app registrations in prerequisites using app creation scripts, then you should already have these values updated in your local repository.

Run the App

In order to run the Azure Communication Services Authentication Server sample,

  1. Go to the project src directory.

    # navigate to the src directory
    cd communication-services-authentication-hero-csharp/src
  2. Run the following command.

    # Start the server
    dotnet run

    Note: You can also run the selected project using the Visual Studio.

  3. We have two ways of testing the backend service

    • Calling the backend APIs directly with an Azure Active Directory Access Token
    • Using the MinimalClient

    Please see the two options in detail here. Test backend service.

    Here is a set of endpoints that can be tested. API Endpoints.

  4. During local development/testing, if the identity mapping needs to be verified in Graph for /api/user and /api/token endpoint, please use Graph Explorer. Sign in with your Azure Active Directory Identity and verify the response on GET https://graph.microsoft.com/v1.0/me/extensions endpoint.

Note: Want to contribute to this sample and help us make it even better? Check our contribution guide.