Skip to content

alfredocastromytaskpanel/NextechAREvents

Repository files navigation

WebAPI POC demo to create MS Graph Events from Inferno Events.

Pre-requisites

Setup

Step 1: Clone or download this repository

From your shell or command line:

git clone https://github.com/JolokiaCorporation/nextech-calendar-service-poc.git

or download and extract the repository .zip file.

Step 2: Register the sample applications with your Azure Active Directory tenant

Follow the steps below to manually walk through the steps to register and configure the applications in the Azure portal.

Choose the Azure AD tenant where you want to create your applications

As a first step you'll need to:

  1. Sign in to the Azure portal.
  2. If your account is present in more than one Azure AD tenant, select your profile at the top right corner in the menu on top of the page, and then switch directory to change your portal session to the desired Azure AD tenant..

Register the service app (NextechAREvents)

  1. Navigate to the Microsoft identity platform for developers App registrations page.
  2. Select New registration.
  3. In the Register an application page that appears, enter your application's registration information:
    • In the Name section, enter a meaningful application name that will be displayed to users of the app, for example NextechAREvents or another name as you wish.
    • Under Supported account types, select **Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) **.
    • In the Redirect URI (optional) section, select Web in the combo-box and enter the following redirect URI: https://localhost:44351/api/Home or the URL where you will run the WebAPI.
  4. Select Register to create the application.
  5. In the app's registration screen, find and note the Application (client) ID. You use this value in your app's configuration file(s) later in your code.
  6. Select Save to save your changes.
  7. In the app's registration screen, click on the Certificates & secrets blade in the left to open the page where we can generate secrets and upload certificates.
  8. In the Client secrets section, click on New client secret:
    • Type a key description (for instance app secret),
    • Select one of the available key durations (In 1 year, In 2 years, or Never Expires) as per your security posture.
    • The generated key value will be displayed when you click the Add button. Copy the generated value for use in the steps later.
    • You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
  9. In the app's registration screen, click on the API permissions blade in the left to open the page where we add access to the APIs that your application needs.
    • Click the Add a permission button and then,
    • Ensure that the Microsoft APIs tab is selected.
    • In the Commonly used Microsoft APIs section, click on Microsoft Graph
    • In the Application permissions section, select the User.Read.All, Mail.Send and Calendars.ReadWrite in the list. Use the search box if necessary.
    • Click on the Add permissions button at the bottom.
  10. Click on Grant admin consent for Nextech AR solutions

Configure the service app (NextechAREvents) to use your app registration

Open the project in your IDE (like Visual Studio or Visual Studio Code) to configure the code.

In the steps below, "ClientID" is the same as "Application ID" or "AppId".

  1. Open the NextechAREvents\appsettings.json file
  2. Find the app key TenantId and replace the existing value with the TenantId from your AzureAD tenant.
  3. Find the app key ClientId and replace the existing value with the application ID (clientId) of the NextechAREvents application copied from the Azure portal.
  4. Find the app key ClientSecret and replace the existing value with the key you saved during the creation of the NextechAREvents app, in the Azure portal.
  5. Replace the DefaultOrganizerUserId with a valid user id in you AzureAD, this will be the organizer for all event send through the WebAPI.
  6. Check for the InfernoAPIUrl, this must be the URL for the Inferno WebAPI to obtain the Inferno Events.
  7. Find the InfernoAPIKey and replace for the user InfernoAPIKey that you wish to use to gain access to the InfernoAPI to obtain the Events.
  8. Find the DefaultConnection and replace with a valid connection string to a SQLServer database instance.

Step 2: Run the sample

You can run the sample by using either Visual Studio or command line interface as shown below:

Run the sample using Visual Studio

Clean the solution, rebuild the solution, then go to View menu, then Other Windows, then click on Package Manager Console, and run the update-database command and wait for successful database creation, at last run the WebAPI from VisualStudio.

When you start the Web API from Visual Studio, depending on the browser you use, you'll get the swagger index.

swagger

DB considerations

  1. You must have remote access enabled in SQLServer.
  2. You must have a username and password configured for the login.
  3. In the 'appsettings' you should have a Connection String similar to this "Server=[IP example-> 10.10.10.5];Database=InfernoAREvents;User Id=[user];Password=[pass];"
  4. This may vary based on the version of the SQLServer and where the DB service is located.

Deploy Docker Image

  1. Go to the repository directory(/)
  2. docker build . -t nextech
  3. docker run -d --name nextech -p 80:80 -p 443:443 nextech

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published