How manicharan0485/oauth-integration works
This is a small Express demo for Microsoft Entra ID and GitHub sign-in, profile retrieval, token refresh, and webhook handling. The main workflow starts in the browser, creates session-bound state and a PKCE challenge, redirects to a provider, validates the callback, exchanges the code, fetches a profile, and stores tokens and profile in memory. Separate branches handle refresh, profile/event display, and GitHub and Graph webhooks. The map follows the shown routes and calls; provider endpoints and webhook semantics are also documented in the README.
Main entry points: server.js HTTP routes · oauth.js OAuth and PKCE · providers.js Provider definitions · webhooks.js Graph notification check
Components 13
OAuth flow
- OAuth and PKCE
src/oauth.js - Provider definitions
src/providers.js
App and sessions
- HTTP routes
src/server.js - Session state
src/server.js - Profile and events views
src/server.js
Webhooks
- GitHub signature check
src/webhooks.js - Graph notification check
src/webhooks.js - In-memory events
src/server.js
Other components
- Browser
- Entra ID and GitHub
- Graph and GitHub profile APIs
- GitHub webhook sender
- Microsoft Graph
Connections 23
- Browser → HTTP routes: starts sign-in
README.md - HTTP routes → Session state: binds state
src/server.js - HTTP routes → OAuth and PKCE: builds redirect
src/server.js - OAuth and PKCE → Provider definitions: reads endpoints
src/oauth.js - Browser → Entra ID and GitHub: follows redirect
README.md - Entra ID and GitHub → HTTP routes: returns callback
README.md - HTTP routes → Session state: checks state
src/server.js - HTTP routes → OAuth and PKCE: exchanges code
src/server.js - OAuth and PKCE → Entra ID and GitHub: posts token request
src/oauth.js - HTTP routes → Provider definitions: fetches profile
src/server.js - Provider definitions → Graph and GitHub profile APIs: requests profile
src/providers.js - HTTP routes → Session state: stores tokens and profile
src/server.js - Browser → HTTP routes: requests refresh
src/server.js - HTTP routes → OAuth and PKCE: refreshes token
src/server.js - HTTP routes → Profile and events views: serves views
src/server.js - Profile and events views → Session state: reads profile
src/server.js - GitHub webhook sender → HTTP routes: posts webhook
README.md - HTTP routes → GitHub signature check: verifies signature
src/server.js - HTTP routes → In-memory events: records event
src/server.js - Microsoft Graph → HTTP routes: posts notification
README.md - HTTP routes → Graph notification check: checks notification
src/server.js - Graph notification check → In-memory events: returns valid events
src/server.js - Profile and events views → In-memory events: reads events
src/server.js