- Install .Net.
- (Recommended) Install Visual Studio.
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
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
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:
- This may take some time the first time it runs.
- To learn more dotnet commands, please visit .NET CLI overview
- You can also build the repo using Visual Studio:
- Right click on the solution
ACSAuthenticationSolution.sln
in Solution Explorer.- Click on Build Solution
To be able to run this sample locally, you will first need to follow those prerequisites.
Before running the sample, you will need to replace the values in the appsettings.json
file:
- Replace
connectionString
andscopes
for the Communication Services - Replace
clientId
,tenantId
andclientSecret
for the Azure Active Directory.
Note: Values of
clientId
,tenantId
andclientSecret
are all from yourauther-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.
In order to run the Azure Communication Services Authentication Server sample,
-
Go to the project
src
directory.# navigate to the src directory cd communication-services-authentication-hero-csharp/src
-
Run the following command.
# Start the server dotnet run
Note: You can also run the selected project using the Visual Studio.
-
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.
-
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 GEThttps://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.