## Please read CONFIGURATION.md before following these instructions.

# Notion SSO Auto-Redirect Extension

This Chrome extension automatically redirects users from the Notion login page to your organization's Microsoft SSO login page.

## What It Does

When a user's Notion session expires (after 12 hours), this extension automatically handles the login process on ANY Notion page.

**Works in these scenarios:**

1. **User visits Notion login page directly** → Auto-fills email and clicks SSO
2. **User visits a specific Notion page (session expired)** → Detects login modal, auto-fills email, clicks "Single sign-on (SSO)"
3. **Session times out while viewing a page** → Same as #2, returns user to their original page after authentication

**Example:** If a user has `https://www.notion.so/Onboarding-Engineering-2e19717520f8056867be71fffdf3019` open and their session expires, the login modal will appear. The extension will automatically fill the email field and click "Single sign-on (SSO)", taking them through Microsoft authentication and back to the Onboarding page.

## Installation Methods

### Manual Installation (Testing)

1. Open Chrome and go to `chrome://extensions/`
2. Enable "Developer mode" (toggle in top-right corner)
3. Click "Load unpacked"
4. Select the `notion-sso-redirect` folder
5. The extension is now active


## Testing

1. Install the extension manually (Method 1)
2. Go to `https://www.notion.so/login`
3. You should be automatically redirected to the Microsoft SSO page

## Troubleshooting

**Extension not working:**
- Check that the extension is enabled in `chrome://extensions/`
- Verify the SSO URL is correct in `redirect.js`
- Check the browser console for any errors (F12)

**Users can bypass the redirect:**
- This is expected - users can disable extensions. For true enforcement, use Notion's "Require SAML SSO" setting in workspace settings.

## Security Notes

- This extension only activates on Notion login pages
- It requires minimal permissions
- Source code is fully transparent and auditable
- No data is collected or transmitted
