Skip to content

How to define a specific scope #1

@DeeDeeS

Description

@DeeDeeS

Hi,

i'm recently installed your bundle solution for google api client.
I have follow your differents configurations explanation :

  • Step 1: Using Composer
  • Step 2: Register the bundle
  • Step 3: Configure the bundle

but i don't understand how to specify the scope for Google Analytics Service

my code on Symfony 2.4.5 bundle :

$request = $this->getRequest();
$session = $request->getSession();

    $client = $this->get('happyr.google.api.client');
    $service = $this->get('happyr.google.api.analytics');

    if ($request->query->has('code')) {           
        $client->authenticate($request->query->get('code'));
        $session->set('token', $client->getAccessToken());
    }

    if ($session->has('token')) {
        $client->setAccessToken($session->get('token'));
    }

    if ($client->getAccessToken()) {           
        $session->set('token', $client->getAccessToken());

    } else {
        return $this->redirect($client->createAuthUrl());  
    }            
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions