9.1 KiB
External Authentication User Guide
Overview
This guide explains how to configure and use external authentication providers (Google, GitHub, Microsoft) with Gatehouse. External authentication allows users to sign in using their existing accounts from these providers, eliminating the need to remember additional passwords.
For Users
Linking an External Account
-
Navigate to Security Settings
- Go to Settings → Security in the Gatehouse application
- Find the "Linked Accounts" section
-
Connect Your Account
- Click Connect next to your desired provider (Google, GitHub, or Microsoft)
- You will be redirected to the provider's login page
- Sign in and grant permission to share your profile with Gatehouse
-
Confirmation
- After successful authentication, you will see a confirmation message
- Your account is now linked and can be used for future logins
Logging In with External Accounts
-
On the Login Page
- Click the "Sign in with Google" (or other provider) button
- Alternatively, use the "Login with Google" option on the login form
-
Authentication
- You will be redirected to the provider's login page
- Sign in with your provider credentials
- Grant permission if prompted
-
Access Granted
- After successful authentication, you will be redirected back to Gatehouse
- Your session will be created automatically
Unlinking an External Account
-
Go to Security Settings
- Navigate to Settings → Security
- Find the "Linked Accounts" section
-
Disconnect
- Click Disconnect next to the account you want to unlink
- Confirm the action in the dialog
-
Important Notes
- You must have at least one other authentication method linked
- You cannot unlink your last authentication method
- Consider adding a password or another method first
For Administrators
Configuring Google OAuth
Step 1: Create a Google Cloud Project
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to APIs & Services → OAuth consent screen
- Select External user type
- Fill in the required information:
- Application name
- User support email
- Application homepage link
- Authorized redirect URI:
https://your-domain.com/api/v1/auth/external/google/callback
Step 2: Create OAuth Credentials
- Navigate to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Select Web application
- Add your authorized redirect URI
- Click Create
- Copy the Client ID and Client Secret
Step 3: Configure in Gatehouse
- Log in to Gatehouse as an organization admin
- Navigate to Settings → Authentication
- Find the Google OAuth section
- Enter your Client ID and Client Secret
- Configure optional settings:
- Hosted Domain: Restrict to specific domain (e.g.,
company.com) - Access Type:
offlineto get refresh tokens - Prompt:
consentto force re-consent
- Hosted Domain: Restrict to specific domain (e.g.,
- Add allowed redirect URIs
- Click Save
Step 4: Verify Configuration
- Try initiating a login flow
- Ensure the OAuth consent screen displays correctly
- Test account linking from a user account
Configuring GitHub OAuth
Step 1: Create a GitHub OAuth App
- Go to GitHub Developer Settings
- Click New OAuth App
- Fill in the application details:
- Application name: Gatehouse (or your custom name)
- Homepage URL:
https://your-domain.com - Authorization callback URL:
https://your-domain.com/api/v1/auth/external/github/callback
- Click Register application
- Copy the Client ID and generate a Client Secret
Step 2: Configure in Gatehouse
- Log in to Gatehouse as an organization admin
- Navigate to Settings → Authentication
- Find the GitHub OAuth section
- Enter your Client ID and Client Secret
- Add allowed redirect URIs
- Click Save
Configuring Microsoft OAuth
Step 1: Register an Application in Azure AD
- Go to Azure Portal
- Navigate to Azure Active Directory → App registrations
- Click New registration
- Fill in the details:
- Name: Gatehouse (or custom name)
- Supported account types: Choose based on your needs
- Redirect URI: Select Web and add
https://your-domain.com/api/v1/auth/external/microsoft/callback
- Click Register
- Note the Application (client) ID
- Navigate to Certificates & secrets
- Create a new client secret
- Copy the secret value (not the ID)
Step 2: Configure in Gatehouse
- Log in to Gatehouse as an organization admin
- Navigate to Settings → Authentication
- Find the Microsoft OAuth section
- Enter your Client ID and Client Secret
- Add allowed redirect URIs
- Click Save
Managing Provider Settings
Viewing Provider Status
- Navigate to Settings → Authentication
- View the status of each provider:
- Configured: Credentials are set up
- Active: Provider is enabled for use
- Not Configured: Needs setup
Updating Configuration
- Click Edit on the provider you want to update
- Modify the settings as needed
- Click Save to apply changes
Disabling a Provider
- Click Edit on the provider
- Toggle Enable Provider to off
- Click Save
- Users will no longer be able to use this provider
Deleting Configuration
- Click Delete on the provider
- Confirm the deletion
- All linked accounts remain but users cannot link new accounts
Troubleshooting Common Issues
"Google login is not available"
Cause: Provider not configured or disabled
Solution:
- Check if Google OAuth is configured in settings
- Verify credentials are correct
- Ensure provider is enabled
"OAuth session expired"
Cause: State parameter expired (10-minute timeout)
Solution:
- Try the login/link flow again
- Complete the flow within 10 minutes of initiation
"Redirect URI mismatch" error from provider
Cause: Redirect URI in provider console doesn't match Gatehouse configuration
Solution:
- Verify redirect URI in provider's console
- Ensure it matches exactly (including trailing slash)
- Common format:
https://your-domain.com/api/v1/auth/external/google/callback
"Email already exists" when registering
Cause: Another Gatehouse account uses the same email
Solution:
- Login with your existing Gatehouse account
- Link the external account from settings instead
- Or use a different email with the external provider
Cannot unlink account
Cause: It's your last authentication method
Solution:
- Add another authentication method first (password, TOTP, etc.)
- Then you can unlink the external account
"Access denied" from Google/Microsoft
Cause: User denied permission during consent
Solution:
- Ask user to try again
- User should ensure they grant all requested permissions
Security Best Practices
For Users
- Review permissions before granting access
- Disconnect unused accounts to reduce attack surface
- Enable MFA on your external provider accounts
- Use unique emails for different services when possible
For Administrators
- Limit authorized domains to your organization's domain
- Review linked accounts periodically
- Monitor audit logs for suspicious activity
- Rotate credentials regularly
- Keep redirect URIs up to date
- Enable rate limiting to prevent abuse
FAQ
Can I link multiple accounts from the same provider?
Yes, you can link multiple Google/GitHub/Microsoft accounts, each with a different email address.
What happens if I change my external provider password?
Nothing changes - your Gatehouse account remains linked. You can continue logging in with the external provider.
Can I use external auth without a password?
Yes, once you link an external account, you can use it as your primary authentication method.
Will external auth work if the provider is down?
No, if the external provider (Google, GitHub, Microsoft) is experiencing an outage, users won't be able to authenticate using that provider.
Can I use external auth for SSO across organizations?
External auth is per-organization. Each organization can configure their own provider credentials.
How are my tokens stored?
Provider tokens (access tokens, refresh tokens) are encrypted at rest using industry-standard encryption.
Can I link an account with a different email?
Yes, but note:
- The external account's email will be associated with your Gatehouse account
- You can have multiple linked accounts with different emails
Support
For issues not covered in this guide:
- Check the API Documentation
- Review the Architecture Documentation
- Contact your organization administrator
- Check application logs for detailed error messages
Last Updated: 2024-01-20 Gatehouse Identity Platform