HUB
Sign inSign up

seanmcilvenna/azuremap

By seanmcilvenna

•Updated 10 months ago

Image
0

680

seanmcilvenna/azuremap repository overview

⁠Active Directory Map

Active Directory Map displays employees from Microsoft Entra ID (Azure AD) on a world map using their city/state/country attributes.

Buy me a coffee⁠

⁠Capabilities

  • Azure AD OAuth login for interactive access.
  • Optional embed-token access that can bypass OAuth (useful for SharePoint, kiosks, or wall displays).
  • Reads users from Microsoft Graph using a service-to-service app registration.
  • Geocodes location data with the Google Geocoding API.
  • Renders a live map with the Google Maps JavaScript API.

⁠Docker

The published image is seanmcilvenna/azuremap:latest.

⁠Run with environment variables
docker run --name azuremap -p 3001:3001 ^
  -e SESSION_SECRET="change-me" ^
  -e AZURE_TENANT_ID="your-tenant-id" ^
  -e AZURE_USER_CLIENT_ID="your-user-client-id" ^
  -e AZURE_USER_CLIENT_SECRET="your-user-client-secret" ^
  -e AZURE_USER_REDIRECT_URI="http://localhost:3001/auth/redirect" ^
  -e AZURE_SERVICE_CLIENT_ID="your-service-client-id" ^
  -e AZURE_SERVICE_CLIENT_SECRET="your-service-client-secret" ^
  -e GOOGLE_API_KEY="your-google-api-key" ^
  -e EMBED_TOKEN="optional-embed-token" ^
  seanmcilvenna/azuremap:latest
⁠Run with a config file

Mount a config.json and point the container at it with CONFIG_PATH (or set variables directly).

docker run --name azuremap -p 3001:3001 ^
  -e CONFIG_PATH="/app/config/config.json" ^
  -v ${PWD}\config\config.json:/app/config/config.json:ro ^
  seanmcilvenna/azuremap:latest

⁠Token bypass (embed mode)

If you set an embed token, you can bypass OAuth by passing a token query parameter. Example:

http://localhost:3001/?token=YOUR_EMBED_TOKEN

The app strips the token from the URL after the first request, but you should still treat it as a secret.

⁠Configuration

Environment variables take precedence over config/config.json. Use one or the other (or a mix) depending on how you deploy. (If you use a .env file, load it via your process manager or shell; the app does not auto-load dotenv.)

⁠Server
  • server.port / PORT: Port the Express server listens on. Default: 3001.
  • server.sessionSecret / SESSION_SECRET: Secret used to sign session cookies (required).
  • server.embedToken / EMBED_TOKEN: Optional shared secret that enables token bypass.
  • server.appTitle / APP_TITLE: Title and header text for the page. Default: Azure Map.
  • server.buyMeCoffeeUrl / BUY_ME_A_COFFEE_URL: Optional link shown in the header. Defaults to https://www.buymeacoffee.com/seanmcilvenna. Set to blank to hide.
⁠Azure AD (User auth app registration)
  • azureAd.tenantId / AZURE_TENANT_ID: Azure tenant ID (directory ID).
  • azureAd.userAuth.clientId / AZURE_USER_CLIENT_ID: Client ID for the user-auth app registration.
  • azureAd.userAuth.clientSecret / AZURE_USER_CLIENT_SECRET: Client secret for the user-auth app registration.
  • azureAd.userAuth.redirectUri / AZURE_USER_REDIRECT_URI (or AUTH_REDIRECT_URI): OAuth redirect URI (must match the app registration). Example: http://localhost:3001/auth/redirect.
⁠Azure AD (Service-to-service app registration)
  • azureAd.service.clientId / AZURE_SERVICE_CLIENT_ID: Client ID for the service app registration.
  • azureAd.service.clientSecret / AZURE_SERVICE_CLIENT_SECRET: Client secret for the service app registration.
⁠Google
  • google.apiKey / GOOGLE_API_KEY: Google API key with access to Maps JavaScript API and Geocoding API.

⁠Azure App Registration setup (basic)

You need two app registrations: one for user login (delegated permissions) and one for service-to-service Graph access (application permissions).

⁠1) User login app (OAuth)
  1. In Azure Portal, create a new App Registration.
  2. Under Authentication, add a Web platform and set the redirect URI to your app, e.g. http://localhost:3001/auth/redirect.
  3. Under Certificates & secrets, create a new client secret.
  4. Under API permissions, add Microsoft Graph delegated permission User.Read.
  5. Record the Tenant ID, Client ID, and Client Secret for configuration.
⁠2) Service app (Graph client credentials)
  1. Create a second App Registration for the service account.
  2. Under Certificates & secrets, create a new client secret.
  3. Under API permissions, add Microsoft Graph application permission User.Read.All (or Directory.Read.All if required).
  4. Grant admin consent for the tenant.
  5. Record the Client ID and Client Secret for configuration.

⁠Google API key setup (basic)

  1. Create or select a Google Cloud project.
  2. Enable Maps JavaScript API and Geocoding API.
  3. Create an API key.
  4. (Recommended) Restrict the key to your HTTP referrers for the Maps JavaScript API and to your server IPs for the Geocoding API, or use separate keys if you want strict restrictions.
Tag summary
Recent tags
Content type
Image
Digest
sha256:a25491003…
Size
51.2 MB
Last updated
10 months ago
docker pull seanmcilvenna/azuremap:latest