FastAPI Teams Bot OAuth Integration

Job ID: 39640243

Budget: €30 – €250 EUR

Project: OAuth Integration for Python FastAPI Teams Bot (No Azure)
Objective
Secure an existing Microsoft Teams bot written in Python using FastAPI, hosted on Railway, by adding OAuth2 authentication via an external provider (Auth0, Keycloak, etc.), and restricting access to a list of authorized users based on email address.

Requirements
The bot is already implemented with FastAPI and deployed on Railway.

Implement OAuth2 login flow with an external provider (no Azure AD, no Azure Bot Service).

On user message:

Send an Adaptive Card with a “Login” button (Action.OpenUrl).

After the user logs in:

Retrieve the user's email from the OAuth provider (via token or /userinfo endpoint).

Check if the email is in an authorized whitelist (defined in an environment variable or a config file).

If authorized, send a welcome message.

If unauthorized, send an access denied message.

Define two FastAPI routes:

/auth/login – initiates the OAuth flow.

/auth/callback – handles token exchange and user verification.

Ensure compatibility with Microsoft Teams' message format and Bot Framework.

Deliverables
OAuth2 integration into the existing FastAPI bot (Auth0 preferred).

Working Adaptive Card for login prompt.

Secure access control logic based on email whitelist.

Clean, maintainable Python code, ready to deploy on Railway.

Deployment instructions and .env configuration template.


you need to have exeperience in developpement of bot with microsoft teams without azure
Related categories: Python Node.js OAuth API Development FastAPI Bot Development