Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function actions()
- {
- return [
- 'auth' => [
- 'class' => 'yiiauthclientAuthAction',
- 'successCallback' => [$this, 'oAuthSuccess'],
- ],
- ];
- }
- public function oAuthSuccess($client) {
- // get user data from client
- $userAttributes = $client->getUserAttributes();
- return $this->render('say',['first_name' => $userAttributes['first_name'],'last_name' => $userAttributes['last_name'], ]);
- // do some thing with user data. for example with $userAttributes['email']
- }
- <?php
- use yiihelpersHtml;
- ?>
- <?= Html::encode($first_name) ?>
- <?= Html::encode($last_name) ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement