Skip to content

Instantly share code, notes, and snippets.

@Leko
Created February 22, 2014 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Leko/9157922 to your computer and use it in GitHub Desktop.
Save Leko/9157922 to your computer and use it in GitHub Desktop.
Google認証からカレンダー一覧を取得するとこまで

コンソール:https://cloud.google.com/console/project/

  • APIsでCalendar APIをONに

  • CredentialsでCREATE NEW CLIENT ID押して登録

    • Client ID、Client secret, Redirect URLsをコピー
  • CredentialsでCREATE NEW KEY押して登録

    • API keyってのを登録
  • Consent screenでProduct nameを登録

  • 設定ファイルを書き換え

return array(
    // True if objects should be returned by the service classes.
    // False if associative arrays should be returned (default behavior).
    'use_objects' => true,
  
    // The application_name is included in the User-Agent HTTP header.
    'application_name' => 'HOUR',

    // OAuth2 Settings, you can get these keys at https://code.google.com/apis/console
    'client_id' => '662155359262.apps.googleusercontent.com',
    'client_secret' => 'EaBj6dZe54IqcSbnKyJ1qYQs',
    'redirect_uri' => 'http://localhost/auth/callback',

    // The developer key, you get this at https://code.google.com/apis/console
    'developer_key' => 'AIzaSyAdCmJsNoQXHxZadMHYGgXnsK6xpxil6Bw',
    // Site name to show in the Google's OAuth 1 authentication screen.
    'site_name' => '',

    // Which Authentication, Storage and HTTP IO classes to use.
    'authClass'    => 'apiOAuth2',

    // Definition of service specific values like scopes, oauth token URLs, etc
    'services' => array(
	#Example: to work with Google Calendar you must specify its scope
        'calendar' => array('scope' => 'https://www.googleapis.com/auth/calendar'),
    ),

);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment