Skip to content
Notifications
Clear all

Showcase: Built a simple tool to visualize our Auth0 tenant's config.

2 Posts
2 Users
0 Reactions
1 Views
(@ci_cd_plumber)
Reputable Member
Joined: 3 months ago
Posts: 189
Topic starter   [#22267]

Ever tried to get a clear picture of your Auth0 tenant's setup? The dashboard is fine for tweaks, but trying to map out all your applications, connections, rules, and API relationships for an audit or migration is a pain. You're clicking through a dozen pages, taking screenshots, and hoping you didn't miss something.

I got sick of that, so I built a small CLI tool that dumps the config to a format Graphviz can render. It gives you a visual dependency graph. No more guessing which app uses which connection or what custom domains are active.

It uses the Management API. You'll need `M2M_APP_CLIENT_ID`, `M2M_APP_CLIENT_SECRET`, and `AUTH0_DOMAIN`. The script pulls down key entities and writes a `.dot` file.

Here's the core of the fetch and structure logic:

```python
# Simplified snippet - error handling omitted
def get_all_apps(auth0):
# Includes: name, client_id, app_type, callbacks, allowed_logout_urls, allowed_origins, connections
pass

def get_all_connections(auth0):
# Includes: name, strategy, enabled_clients
pass

def generate_dot(apps, connections, apis):
print('digraph auth0_config {')
print(' node [shape=box];')
for app in apps:
print(f' "{app["name"]}" [color=blue];')
for conn in connections:
print(f' "{conn["name"]}" [color=green];')
# Draw edges based on enabled_clients and connections
# ...
print('}')
```

Run it, then pipe the output to `dot`:
```bash
python tenant_visualizer.py > tenant.dot
dot -Tpng tenant.dot -o tenant.png
```

The result is a clear diagram showing:
* Applications as blue boxes.
* Database/Social connections as green boxes.
* APIs as orange diamonds.
* Lines showing which apps use which connections and APIs.

It's been solid for us to spot orphaned configurations and understand the real-world flow before we started a major refactor. The script is rough, but if there's interest, I can clean it up and put it on GitHub. What do others use for tenant documentation?


Build once, deploy everywhere


   
Quote
(@averyk)
Trusted Member
Joined: 2 weeks ago
Posts: 87
 

That's a great practical solution for a very common problem. Auditors always ask for a clean diagram, and the admin console just isn't built for that view.

One thing to flag for anyone trying this: be mindful of where that .dot file ends up. It'll contain a full map of your apps, client IDs, and connections. Treat it with the same sensitivity as an exported config file itself. A quick `sed` to scrub real app names for dummy placeholders before sharing the visual might be wise.

I've seen similar scripts extended to highlight gaps, like applications with no associated connections or rules that affect multiple apps. Any plans to add risk flags like that?


Review first, buy later.


   
ReplyQuote