All calls needs an active Azure AD Token
Calls executes in parallel. When a call has retrieved it's data it will be saved to a MongoDB. Then there will be tests executed on the data retrieved.
When all calls are finished, tests across all retrieved data will be executed.
{
"systems": [
"aad",
"ad",
"feide",
"sds",
"sync",
"vis",
"visma",
"equitrac",
"vigoot",
"vigolaerling"
],
"user": {
"userPrincipalName": "bjarne.betjent@vtfk.no", // can also be "displayName", "samAccountName" or "employeeNumber"
"expectedType": "employee|student",
...userProps
}
}
Search for cached users in db
q : What to search for
top (optional) : Search limit
Call individual systems without updating db
Get OnPremises Active Directory user account
{
"displayName": "Bjarne Betjent",
"domain": "login|skole",
"properties": [
"title",
"memberOf",
"employeeNumber"
]
}
{
"userPrincipalName": "bjarne.betjent@vtfk.no",
"domain": "login|skole",
"properties": [
"title",
"memberOf",
"employeeNumber"
]
}
{
"employeeNumber": "01010101011",
"domain": "login|skole",
"properties": [
"title",
"memberOf",
"employeeNumber"
]
}
{
"samAccountName": "bja0101",
"domain": "login|skole",
"properties": [
"title",
"memberOf",
"employeeNumber"
]
}
Get Visma HRM user account
{
"givenName": "Bjarne",
"surName": "Betjent"
}
{
"employeeNumber": "01010101011"
}
Get OnPremises FEIDE user account
{
"displayName": "Bjarne Betjent"
}
{
"userPrincipalName": "bjarne.betjent@vtfk.no"
}
{
"employeeNumber": "01010101011"
}
{
"samAccountName": "bja0101"
}
Get person object(s) and membership(s) for user account
{
"samAccountName": "bja0101",
"type": "Student|Teacher"
}
{
"userPrincipalName": "bjarne.betjent@vtfk.no",
"type": "Student|Teacher"
}
Get user info from school source system. Will also get user info from PIFU to match data together
{
"employeeNumber": "01010101011"
}
Get info about last synchronization timestamps
Get Azure Active Directory user account + authentication methods
{
"userPrincipalName": "bjarne.betjent@vtfk.no"
}
Get info for user from Equitrac.
If account were locked, it will be unlocked and info returned will reflect this
{
"samAccountName": "bja0101"
}
Has user recommended info in Public 360
{
"employeeNumber": "01010101011",
"samAccountName": "bja0101"
}
Get user info from VIGO OT
{
"employeeNumber": "01010101011",
"title": "Elev OT"
}
Get user info from VIGO Opplæring (Lærling)
{
"employeeNumber": "01010101011",
"title": "Lærling"
}
- Create a
local.settings.json
{ "IsEncrypted": false, "Values": { "FUNCTIONS_WORKER_RUNTIME": "node", "AzureWebJobsStorage": "UseDevelopmentStorage=true", "AD_AUTO_USERS": "OU=AUTO USERS", "AD_AUTO_DISABLED_USERS": "OU=AUTO DISABLED USERS", "CLIENT_ID": "0000000-0000-0000-0000-000000000000", "CLIENT_SECRET": "ljngbølnbljkdafsbløjkadbhpiuaergpiuearwhgpuiøo", "DEFAULT_CALLER": "noen.andre@vtfk.no", "DEMO": false, "DEMO_SKIP_DB": false, "DEMO_USER": "noen.andre@vtfk.no", "DUST_JWT_SECRET": "Very very secret secret", "FEIDE_MFA_AAD": "urn:mace:feide.no:auth:method:azuread", "FEIDE_MFA_GA": "urn:mace:feide.no:auth:method:ga", "FEIDE_MFA_SMS": "urn:mace:feide.no:auth:method:sms", "FEIDE_PRINCIPAL_NAME": "@vtfk.no", "FEIDE_ORGANIZATION_DN": "O=Vestfold og Telemark fylkeskommune,DC=vtfk,DC=no", "FINT_API_URL": "https://fint.dev/api", "FINT_BETA": false, "FINT_JWT_SECRET": "Very very secret secret", "FINT_TIMEOUT": 10000, "GRAPH_USER_PROPERTIES": "accountEnabled,assignedLicenses,birthday,businessPhones,companyName,createdDateTime,deletedDateTime,department,displayName,givenName,jobTitle,lastPasswordChangeDateTime,mail,mobilePhone,onPremisesDistinguishedName,onPremisesExtensionAttributes,onPremisesLastSyncDateTime,onPremisesProvisioningErrors,onPremisesSamAccountName,onPremisesSyncEnabled,proxyAddresses,signInSessionsValidFromDateTime,surname,userPrincipalName", "MONGODB_CONNECTION": "mongodb+srv://<user>:<password>@cluster0.jlu5j.azure.mongodb.net?retryWrites=true&w=majority", "MONGODB_COLLECTION": "collection", "MONGODB_COLLECTION_SDS": "sds-collection", "MONGODB_COLLECTION_USERS": "user-collection", "MONGODB_COLLECTION_VIGO_LAERLING": "laerling", "MONGODB_COLLECTION_VIGO_OT": "ot", "MONGODB_NAME": "db", "MONGODB_NAME_SDS": "sds-db", "MONGODB_NAME_VIGO_LAERLING": "db", "MONGODB_NAME_VIGO_OT": "db", "P360_KEY": "0000000-0000-0000-0000-000000000000", "P360_URL": "https://360server/Biz/v2/api/call/SI.Data.RPC/SI.Data.RPC", "PAPERTRAIL_HOST": "https://logs.collector.solarwinds.com/v1/log", "PAPERTRAIL_TOKEN": "secret token", "PAPERTRAIL_DISABLE_LOGGING": true, "PIFU_URL": "https://pifu.dev/api", "PIFU_JWT_SECRET": "Very very secret secret", "RETRY_WAIT": 3000, "SCRIPT_SERVICE_URL": "https://localhost/dust/invoke", "SOURCE_DATA_SYSTEMS": "ad,vis,visma", "STATUS_ENDPOINT": "report", "STATUS_URL": "http://localhost:7071/api", "USER_SEARCH_LIMIT": 10, "NODE_ENV": "production" }, "Host": { "CORS": "*" } }
- Run
npm i
- Create a new Azure Function in Azure portal
- Copy
AzureWebJobsStorage
setting from Configuration and updatelocal.settings.json
- When debugging function locally, Azure Function should not be running. This to avoid collision between who will process the requests put in StorageAccount
- Create a new
Enterprise application
- Copy
CLIENT_ID
and updatelocal.settings.json
- Copy
CLIENT_SECRET
and updatelocal.settings.json
- Copy
- Create a database in Mongo and update
local.settings.json
- func start