Authentication overview

Eventbrite utilizes OAuth 2.0 for authenticating requests to its Platform API, which enables developers to programmatically manage events, tickets, and attendee data. OAuth 2.0 is an industry-standard protocol designed to allow a third-party application to obtain limited access to an HTTP service, either on behalf of a resource owner or by orchestrating an approval interaction between the resource owner and the HTTP service (OAuth 2.0 Authorization Framework). This approach means that applications do not directly handle user credentials, but instead receive an access token that grants specific permissions. This token is then included in API requests to prove the application's authorization.

The Eventbrite API supports various operations, including creating events, managing attendee lists, processing orders, and retrieving reports. All these actions, when performed via the API, require proper authentication. The choice of OAuth 2.0 flow depends on the type of application being developed. For web applications interacting with user accounts, the Authorization Code Grant flow is typically used. For applications that need to access their own resources without user intervention, the Client Credentials Grant flow may be applicable (Eventbrite Platform API documentation).

Understanding the distinction between authentication and authorization is key. Authentication verifies the identity of a client (e.g., your application), while authorization determines what that client is permitted to do once identified. Eventbrite's OAuth 2.0 implementation handles both: the OAuth flow authenticates your application and the user, and the resulting access token authorizes specific actions based on the granted scopes.

Supported authentication methods

Eventbrite's Platform API primarily supports OAuth 2.0 for securing API calls. This protocol offers a robust and flexible framework for delegated authorization. The specific OAuth 2.0 flows supported are:

  • Authorization Code Grant Flow: This is the most common and secure flow for web applications. It involves redirecting the user to Eventbrite's authorization server to grant permission, after which an authorization code is exchanged for an access token and a refresh token.
  • Client Credentials Grant Flow: This flow is suitable for server-to-server interactions where the application needs to access its own service resources rather than acting on behalf of a user. It directly exchanges the client ID and client secret for an access token.

Other authentication methods like API keys (basic bearer token) are not the primary recommended method for general API access due to the enhanced security features offered by OAuth 2.0, particularly for user-centric applications. The OAuth 2.0 standard is globally recognized for its security benefits, including token expiration, refresh tokens, and granular scope management (OAuth 2.0 Specification).

Authentication Method Comparison

Method When to Use Security Level
OAuth 2.0 (Authorization Code Grant) Web applications requiring user authorization to access their Eventbrite data. High (delegated access, refresh tokens, scope control).
OAuth 2.0 (Client Credentials Grant) Server-to-server applications accessing Eventbrite resources directly linked to the application itself, without user context. High (secure direct access for trusted applications).

Getting your credentials

To begin using the Eventbrite API, you need to register your application to obtain the necessary OAuth 2.0 credentials. This typically involves a few steps:

  1. Create an Eventbrite Account: If you don't already have one, you'll need an Eventbrite organizer account to access the developer portal.
  2. Register Your Application: Navigate to the Eventbrite Platform API documentation and find the section for registering a new application. During registration, you will provide details such as your application name, description, and importantly, the redirect URI(s). The redirect URI is where Eventbrite will send the user back after they authorize your application. For security, this URI must be an exact match to what you register.
  3. Obtain Client ID and Client Secret: Upon successful registration, Eventbrite will issue a unique Client ID and Client Secret for your application. The Client ID is publicly exposed and identifies your application. The Client Secret is confidential and must be kept secure, as it is used to authenticate your application when exchanging authorization codes for access tokens.
  4. Define Scopes: When setting up your application, you will also specify the necessary scopes. Scopes define the level of access your application requests from a user's Eventbrite account (e.g., event_read, event_write, attendee_read). Request only the minimum scopes required for your application's functionality to adhere to the principle of least privilege.

These credentials, particularly the Client Secret, are crucial for your application's security and should be treated with the same level of care as user passwords. Never embed your Client Secret directly into client-side code or public repositories.

Authenticated request example

Once you have obtained an access token using the appropriate OAuth 2.0 flow, you can include it in your API requests. Eventbrite expects the access token to be sent in the Authorization header using the Bearer token scheme. Here's a conceptual example using curl to fetch a user's events:

curl -X GET \
  'https://www.eventbriteapi.com/v3/users/me/events/' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json'

In this example:

  • YOUR_ACCESS_TOKEN should be replaced with the actual access token obtained during the OAuth flow.
  • The -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' header is essential for authenticating the request.
  • The Content-Type: application/json header is a common practice for RESTful APIs, though it might not always be strictly required for GET requests.

For applications using the Authorization Code Grant flow, the process involves:

  1. Redirecting the user to https://www.eventbrite.com/oauth/authorize?response_type=code&client_id=YOUR_CLIENT_ID&redirect_uri=YOUR_REDIRECT_URI&scope=event_read,event_write.
  2. Receiving an authorization code at your YOUR_REDIRECT_URI.
  3. Exchanging the code for an access token and refresh token by making a POST request to https://www.eventbrite.com/oauth/token with your client ID, client secret, and the received code.
  4. Using the obtained access token in subsequent API calls as shown in the curl example.

Always refer to the Eventbrite API reference for specific endpoint details and required parameters.

Security best practices

Implementing robust security measures is paramount when integrating with the Eventbrite API. Adhering to these best practices will help protect your application and user data:

  • Keep Client Secrets Confidential: Your Client Secret is a critical credential. Never embed it in client-side code (e.g., JavaScript in a browser) or expose it in public repositories. Store it securely on your server and access it only from server-side code.
  • Use HTTPS Everywhere: Always use HTTPS for all communication between your application and Eventbrite, including redirects during the OAuth flow and all API requests. This encrypts data in transit, preventing eavesdropping and tampering.
  • Validate Redirect URIs: Ensure that your registered redirect URIs are precise and securely controlled. An improperly configured redirect URI can lead to authorization code or token leakage. Eventbrite performs strict validation of redirect URIs.
  • Implement State Parameter: For Authorization Code Grant flows, use the state parameter to protect against Cross-Site Request Forgery (CSRF) attacks. Generate a unique, unpredictable value for each authorization request, store it securely, and verify it upon receiving the redirect from Eventbrite.
  • Request Minimal Scopes: Follow the principle of least privilege. Request only the specific API scopes that your application genuinely needs to function. This limits the potential impact if your access token is compromised.
  • Securely Store Access and Refresh Tokens: Access tokens are typically short-lived. Refresh tokens, which are used to obtain new access tokens without user re-authorization, are long-lived and equally sensitive. Store both securely, ideally encrypted at rest, and revoke them if compromise is suspected.
  • Handle Token Expiration and Refreshing: Implement logic to gracefully handle access token expiration. Use the refresh token to obtain a new access token when the current one expires. Be prepared to re-initiate the OAuth flow if the refresh token also expires or is revoked.
  • Error Handling: Implement robust error handling for API responses, especially for authentication and authorization errors. Provide clear, user-friendly messages without exposing sensitive technical details.
  • Regularly Review Permissions: Periodically review the permissions your application has and ensure they are still necessary. Remove any unnecessary access rights.
  • Stay Updated: Keep your application's dependencies and frameworks updated to benefit from the latest security patches. Monitor Eventbrite's developer documentation for any security announcements or changes to their authentication protocols.