The powerful data exploration & web app framework for Python.
—
Complete authentication and authorization system for Panel applications, supporting OAuth providers, basic authentication, and custom login handlers. Essential for securing enterprise applications and controlling access to sensitive data and functionality.
Pre-built OAuth integration for popular identity providers, enabling secure single sign-on authentication flows.
class GoogleLoginHandler:
"""Google OAuth login handler"""
class GitHubLoginHandler:
"""GitHub OAuth login handler"""
class AzureAdLoginHandler:
"""Azure Active Directory OAuth login handler"""
class AzureAdV2LoginHandler:
"""Azure Active Directory v2.0 OAuth login handler"""
class Auth0Handler:
"""Auth0 OAuth login handler"""
class GitLabLoginHandler:
"""GitLab OAuth login handler"""
class OktaLoginHandler:
"""Okta OAuth login handler"""
class BitbucketLoginHandler:
"""Bitbucket OAuth login handler"""Traditional username/password authentication with configurable user management.
class BasicLoginHandler:
"""Basic username/password login handler"""
class PAMLoginHandler:
"""PAM (Pluggable Authentication Modules) login handler for system authentication"""
class PasswordLoginHandler:
"""Custom password authentication handler"""Base classes and providers for integrating authentication into Panel applications.
class BasicAuthProvider:
"""Base authentication provider for Panel applications"""
class OAuthProvider:
"""OAuth-based authentication provider with customizable settings"""Flexible authentication handlers for custom authentication flows.
class GenericLoginHandler:
"""Generic login handler for custom authentication implementations"""
class CodeChallengeLoginHandler:
"""PKCE (Proof Key for Code Exchange) authentication handler"""
class LogoutHandler:
"""Logout handler for terminating authenticated sessions"""import panel as pn
# Configure OAuth authentication with Google
pn.config.oauth_provider = 'google'
pn.config.oauth_key = 'your-google-client-id'
pn.config.oauth_secret = 'your-google-client-secret'
# Create protected application
@pn.depends(pn.state.user_info)
def protected_app(user_info):
if not user_info:
return pn.pane.HTML("Please log in to access this application")
return pn.Column(
f"# Welcome, {user_info['login']}!",
"This is a protected application area"
)
protected_app().servable()