public function validateAccessToken($accessToken)
    {
        $result = DB::table('oauth_session_access_tokens')
                    ->select('oauth_session_access_tokens.session_id as session_id',
                            'oauth_sessions.client_id as client_id',
                            'oauth_clients.secret as client_secret',
                            'oauth_sessions.owner_id as owner_id',
                            'oauth_sessions.owner_type as owner_type')
                    ->join('oauth_sessions', 'oauth_session_access_tokens.session_id', '=', 'oauth_sessions.id')
                    ->join('oauth_clients', 'oauth_sessions.client_id', '=', 'oauth_clients.id')
                    ->where('access_token', $accessToken)
                    ->where('access_token_expires', '>=', time())
                    ->first();

        return (is_null($result)) ? false : (array) $result;
    }
public function validateAccessToken($accessToken)
    {
        $result = DB::table('oauth_session_access_tokens')
                    ->select('oauth_session_access_tokens.session_id as session_id',
                            'oauth_sessions.client_id as client_id',
                            'oauth_clients.secret as client_secret',
                            'oauth_sessions.owner_id as owner_id',
                            'oauth_sessions.owner_type as owner_type')
                    ->join('oauth_sessions', 'oauth_session_access_tokens.session_id', '=', 'oauth_sessions.id')
                    ->join('oauth_clients', 'oauth_sessions.client_id', '=', 'oauth_clients.id')
                    ->where('access_token', $accessToken)
                    ->where('access_token_expires', '>=', time())
                    ->first();

        return (is_null($result)) ? false : (array) $result;
    }
public function validateAccessToken ( $ accessToken ) { $ result = DB :: table ( 'oauth_session_access_tokens' ) -> select ( 'oauth_session_access_tokens.session_id as session_id' , 'oauth_sessions.client_id as client_id' , 'oauth_clients.secret as client_secret' , 'oauth_sessions.owner_id as owner_id' , 'oauth_sessions.owner_type as owner_type' ) -> join ( 'oauth_sessions' , 'oauth_session_access_tokens.session_id' , '=' , 'oauth_sessions.id' ) -> join ( 'oauth_clients' , 'oauth_sessions.client_id' , '=' , 'oauth_clients.id' ) -> where ( 'access_token' , $ accessToken ) -> where ( 'access_token_expires' , '>=' , time ( ) ) -> first ( ) ; return ( is_null ( $ result ) ) ? false : ( array ) $ result ; }
Validate an access token

Example SQL query:

<code>
SELECT session_id, oauth_sessions.`client_id`, oauth_sessions.`owner_id`, oauth_sessions.`owner_type`
FROM `oauth_session_access_tokens` JOIN oauth_sessions ON oauth_sessions.`id` = session_id WHERE
access_token = :accessToken AND access_token_expires >= UNIX_TIMESTAMP(NOW())
</code>

Expected response:

<code>
array(
'session_id' =>  (int),
'client_id'  =>  (string),
'owner_id'   =>  (string),
'owner_type' =>  (string)
)
</code>

@param  string     $accessToken The access token
@return array|bool              False if invalid or an array as above
Validate an access token