Portal for visualization of data, for the overview and individual profiles.
MCSC-Portal-Users
Current Dev/DevProd environment uses an application registered under
admin.mcsc@strutcreative.com
If you have not yet created a "Converged Application" (aka Azure AD v2.0 endpoint for AAD sign on) you will need to follow these steps:
New application registration
MSCS Portal - <DEV/TEST/PROD>
Generate new password
and store it, you will be prompted to change this upon first login.
Add Platform
Redirect URLs
add http://localhost:3000/auth/openid/return
Logout URL
add http://localhost:3000/logout
Save
Clone this repo locally
git clone https://github.com/Missing-Children-Society-Canada/portal-node.git
Configure environment variables below
.env
file in the root (it will not be checked in as it is excluded in .gitignore
).To run
node server.js
Navigate to http://localhost:3000
Use the below variables in your .env
file or in your Azure Web Application's App Settings.
IdentityMetadata=
ClientID=
ClientSecret=
RedirectUrl=
DestroySessionUrl=
DocDbHost=
DocDbAuthKey=
NotifyPoliceUrl=
ValidateTokenUrl=
RequiredAADGroupId=
CookieEncryptionKey=
CookieEncryptionIv=
AppInsightsInstrumentationKey=
More details for the AAD Passport specific settings can be found in the AAD Passport GitHub page.
The metadata endpoint provided by the Microsoft Identity Portal that provides the keys and other important information at runtime. Example: https://login.microsoftonline.com/<YOUR_AAD_TENANT_NAME>.onmicrosoft.com/v2.0/.well-known/openid-configuration
The client ID of your application in AAD (Azure Active Directory). Can be located here: https://apps.dev.microsoft.com/#/appList
The openid return URL to continue the authentication process. For development use http://localhost:3000/auth/openid/return
, however for production this should be https
and point to the production applications domain.
When you create an application in the Application Registration Portal you are provided the ability to create a Password
(Found under Application Secrets).
This is the URL for your DocumentDB instance where the profile data is queried. The portal expects a database called reporting
and a collection called events
.
A Read-Write Access key for the above Document DB host.
The secure Azure Function URL for the NotifyPolice
API which allows for the emailing of profiles.
The secure Azure Function URL for the ValidateToken
API which allows for authorization validation to view a profile by token ID (instead of standard Passport login authentication).
The AAD Directory Group id which the authenticated user must be a member of to pass authorization checks. If the user is authenticated (can log in), but is not a member of the configured group then they will be denied access (Status: 401).
NOTE: When a user is added to the group it can take a few minutes before this information propagates. It's common to still be directed to
/unauthorized
shortly after adding them to the group.
A 32 character string used for the encryption key for the aes-256-gcm cookie encryption. For more information see the AAD Passport documentation.
You can get a randomly generated
key
&iv
via this Azure Function: TDESGenerate.
A 12 character string used for the IV (Initialization vector ) for the aes-256-gcm cookie encryption. For more information see the AAD Passport documentation.
You can get a randomly generated
key
&iv
via this Azure Function: TDESGenerate (.NET source code).
The Application Insights instrumentation key for analytics.