function __construct(Request $request, $clientId, $clientSecret, $redirectUrl) { parent::__construct($request, $clientId, $clientSecret, $redirectUrl); $scopesConfig = config('services.mozzos.scopes'); $scopesConfig = is_array($scopesConfig) ? $scopesConfig : ['r_user.profile']; $this->scopes = $scopesConfig; }
/** * {@inheritdoc} */ public function user($token = null) { if (!$token) { return parent::user(); } $user = $this->mapUserToObject($this->getUserByToken($token)); return $user->setToken($token); }
/** * Get the POST fields for the token request. * * @param string $code * @return array */ protected function getTokenFields($code) { return array_add(parent::getTokenFields($code), 'grant_type', 'authorization_code'); }
/** * {@inheritdoc}. */ protected function getTokenFields($code) { return array_merge(parent::getTokenFields($code), ['grant_type' => 'authorization_code']); }
/** * {@inheritdoc} */ protected function getCodeFields($state = null) { $fields = parent::getCodeFields($state); if ($this->popup) { $fields['display'] = 'popup'; } return $fields; }
/** * {@inheritdoc} */ protected function getCodeFields($state) { return array_merge(parent::getCodeFields($state), ['type' => 'web_server']); }
/** * Get the POST fields for the token request. * * @param string $code * @return array */ protected function getTokenFields($code) { return parent::getTokenFields($code) + ['grant_type' => 'authorization_code']; }
protected function getTokenFields($code) { return array_merge(parent::getTokenFields($code), ['grant_type' => $this->grantType]); }