Question

I was trying to authenticate a user using EB's loginWidget example, and as I debug,
I discovered that getAccessToken() request always returns a null
even though a session was successfully created.

The parameter I passed in to the loginWidget are:
user secret I got from the app key, and the app key.

Était-ce utile?

La solution

Are you using PHP? If so, this guide should have you covered: https://github.com/ryanjarvinen/eventbrite.php/blob/master/OAUTH2-README.md

By default, PHP's $_SESSION store will be used to save each user's access_token. You'll need PHP session support to be enabled in order to get the basic demo working: https://github.com/ryanjarvinen/eventbrite.php/blob/master/OAUTH2-README.md#2a-using-phps-built-in-_session-storage-optional

PHP's default $_SESSION storage definitely has a few trade offs. If it is not your preferred data storage system, you can provide your own data-management callbacks, allowing you to store the access_token in a cookie, in your database, or in any other location that works well with your system architecture. More information is available here: https://github.com/ryanjarvinen/eventbrite.php/blob/master/OAUTH2-README.md#3-define-data-management-callbacks

Here is a basic implementation example, which takes advantage of the default $_SESSION store: https://github.com/ryanjarvinen/eventbrite.php/blob/master/examples/oauth2-login-example.php

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top