Overview
The Penn Clubs API uses multiple authentication methods to secure endpoints and provide access to user-specific data. Authentication is required for most write operations and personalized content.Authentication Methods
The API supports three authentication backends:- Penn Labs Platform Authentication (Primary)
- Session Authentication (Browser-based)
- Basic Authentication (Testing only)
Penn Labs Platform Authentication
Penn Clubs integrates with the Penn Labs Platform for user authentication. This provides single sign-on across Penn Labs applications using Penn’s authentication system.Bearer token obtained from Penn Labs Platform
- Redirect users to Platform login
- User authenticates with Penn credentials
- Platform redirects back with authorization code
- Exchange code for access token
- Include token in API requests
Session Authentication
For browser-based applications, session authentication is available after logging in through the web interface. Login endpoint:Penn username (e.g., “bfranklin”)
User password
Basic Authentication
Basic authentication is supported for testing and development:Making Authenticated Requests
Using Bearer Token
Include the authorization token in the request header:Using Session Cookie
For browser-based requests, cookies are automatically included:OAuth Integration (Zoom)
Penn Clubs supports OAuth2 integration with Zoom for virtual event management.Zoom OAuth Flow
Authorization URL:user:read- Read user profileuser:write- Update user profilemeeting:read- Read meeting informationmeeting:write- Create and manage meetings
Permission Levels
Authenticated users have different permission levels based on their club membership roles:Basic club member - Can view club information
Club officer - Can manage events and members
Club owner - Full administrative access
Public vs. Authenticated Access
Public Endpoints
Some endpoints are accessible without authentication:GET /api/clubs/- List approved, active clubsGET /api/clubs/{code}/- View individual club detailsGET /api/events/- List public eventsGET /api/tags/- List all tagsGET /api/badges/- List all badges
Authenticated Endpoints
These endpoints require authentication:POST /api/clubs/- Create new clubPATCH /api/clubs/{code}/- Update club informationGET /api/settings/- Get user settingsGET /api/favorites/- List user’s favorited clubsPOST /api/favorites/- Favorite a clubGET /api/memberships/- List user’s memberships
Error Responses
401 Unauthorized
Returned when authentication is required but not provided:403 Forbidden
Returned when authenticated but lacking required permissions:Security Best Practices
Token Storage
- Store tokens securely (use secure storage mechanisms)
- Never commit tokens to version control
- Rotate tokens regularly
HTTPS Only
- Always use HTTPS in production
- Never send credentials over unencrypted connections
Token Refresh
Implement token refresh logic for long-running applications:Development Authentication
For local development, a test user is available:- Username:
bfranklin - Password:
test
http://localhost:8000/api/admin/ to manage test users.
Testing Authentication
Test your authentication setup:Next Steps
- API Overview - Learn about API conventions and response formats
- Clubs Endpoints - Start working with clubs data
- Events Endpoints - Explore event management endpoints