repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FiwareResourceOwner.php
FiwareResourceOwner.getAccessToken
public function getAccessToken(Request $request, $redirectUri, array $extraParameters = []) { $parameters = array_merge([ 'code' => $request->query->get('code'), 'grant_type' => 'authorization_code', 'redirect_uri' => $redirectUri, ], $extraParameters); $...
php
public function getAccessToken(Request $request, $redirectUri, array $extraParameters = []) { $parameters = array_merge([ 'code' => $request->query->get('code'), 'grant_type' => 'authorization_code', 'redirect_uri' => $redirectUri, ], $extraParameters); $...
[ "public", "function", "getAccessToken", "(", "Request", "$", "request", ",", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "parameters", "=", "array_merge", "(", "[", "'code'", "=>", "$", "request", "->", "query", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FiwareResourceOwner.php#L43-L61
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FiwareResourceOwner.php
FiwareResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { if ($this->options['use_bearer_authorization']) { $content = $this->httpRequest( $this->normalizeUrl( $this->options['infos_url'], ['access_token' => $acc...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { if ($this->options['use_bearer_authorization']) { $content = $this->httpRequest( $this->normalizeUrl( $this->options['infos_url'], ['access_token' => $acc...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "options", "[", "'use_bearer_authorization'", "]", ")", "{", "$", "content", "=", "$"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FiwareResourceOwner.php#L66-L92
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FiwareResourceOwner.php
FiwareResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => '{base_url}/oauth2/authorize', 'access_token_url' => '{base_url}/oauth2/token', 'revoke_token_url' => '{base_url}...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => '{base_url}/oauth2/authorize', 'access_token_url' => '{base_url}/oauth2/token', 'revoke_token_url' => '{base_url}...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'authorization_url'", "=>", "'{base_url}/oauth2/autho...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FiwareResourceOwner.php#L97-L122
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php
GenericOAuth1ResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $parameters = array_merge([ 'oauth_consumer_key' => $this->options['client_id'], 'oauth_timestamp' => time(), 'oauth_nonce' => $this->generateNonce(), 'oauth_version' => '1.0...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $parameters = array_merge([ 'oauth_consumer_key' => $this->options['client_id'], 'oauth_timestamp' => time(), 'oauth_nonce' => $this->generateNonce(), 'oauth_version' => '1.0...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "parameters", "=", "array_merge", "(", "[", "'oauth_consumer_key'", "=>", "$", "this", "->", "options", "[", "'c...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php#L32-L61
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php
GenericOAuth1ResourceOwner.getAccessToken
public function getAccessToken(HttpRequest $request, $redirectUri, array $extraParameters = []) { OAuthErrorHandler::handleOAuthError($request); try { if (null === $requestToken = $this->storage->fetch($this, $request->query->get('oauth_token'))) { throw new \RuntimeExce...
php
public function getAccessToken(HttpRequest $request, $redirectUri, array $extraParameters = []) { OAuthErrorHandler::handleOAuthError($request); try { if (null === $requestToken = $this->storage->fetch($this, $request->query->get('oauth_token'))) { throw new \RuntimeExce...
[ "public", "function", "getAccessToken", "(", "HttpRequest", "$", "request", ",", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "OAuthErrorHandler", "::", "handleOAuthError", "(", "$", "request", ")", ";", "try", "{", "if"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php#L76-L120
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php
GenericOAuth1ResourceOwner.getRequestToken
public function getRequestToken($redirectUri, array $extraParameters = []) { $timestamp = time(); $parameters = array_merge([ 'oauth_consumer_key' => $this->options['client_id'], 'oauth_timestamp' => $timestamp, 'oauth_nonce' => $this->generateNonce(), ...
php
public function getRequestToken($redirectUri, array $extraParameters = []) { $timestamp = time(); $parameters = array_merge([ 'oauth_consumer_key' => $this->options['client_id'], 'oauth_timestamp' => $timestamp, 'oauth_nonce' => $this->generateNonce(), ...
[ "public", "function", "getRequestToken", "(", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "timestamp", "=", "time", "(", ")", ";", "$", "parameters", "=", "array_merge", "(", "[", "'oauth_consumer_key'", "=>", "$...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php#L142-L186
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php
GenericOAuth1ResourceOwner.httpRequest
protected function httpRequest($url, $content = null, array $headers = [], $method = null, array $parameters = []) { foreach ($parameters as $key => $value) { $parameters[$key] = $key.'="'.rawurlencode($value).'"'; } if (!$this->options['realm']) { array_unshift($par...
php
protected function httpRequest($url, $content = null, array $headers = [], $method = null, array $parameters = []) { foreach ($parameters as $key => $value) { $parameters[$key] = $key.'="'.rawurlencode($value).'"'; } if (!$this->options['realm']) { array_unshift($par...
[ "protected", "function", "httpRequest", "(", "$", "url", ",", "$", "content", "=", "null", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "method", "=", "null", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "foreach", "(", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth1ResourceOwner.php#L207-L220
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GoogleResourceOwner.php
GoogleResourceOwner.getAuthorizationUrl
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { $url = parent::getAuthorizationUrl($redirectUri, array_merge([ 'access_type' => $this->options['access_type'], 'approval_prompt' => $this->options['approval_prompt'], 'request_visible_actions...
php
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { $url = parent::getAuthorizationUrl($redirectUri, array_merge([ 'access_type' => $this->options['access_type'], 'approval_prompt' => $this->options['approval_prompt'], 'request_visible_actions...
[ "public", "function", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "url", "=", "parent", "::", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array_merge", "(", "[", "'access_type'",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GoogleResourceOwner.php#L40-L55
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GoogleResourceOwner.php
GoogleResourceOwner.revokeToken
public function revokeToken($token) { $response = $this->httpRequest($this->normalizeUrl($this->options['revoke_token_url'], ['token' => $token])); return 200 === $response->getStatusCode(); }
php
public function revokeToken($token) { $response = $this->httpRequest($this->normalizeUrl($this->options['revoke_token_url'], ['token' => $token])); return 200 === $response->getStatusCode(); }
[ "public", "function", "revokeToken", "(", "$", "token", ")", "{", "$", "response", "=", "$", "this", "->", "httpRequest", "(", "$", "this", "->", "normalizeUrl", "(", "$", "this", "->", "options", "[", "'revoke_token_url'", "]", ",", "[", "'token'", "=>"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GoogleResourceOwner.php#L60-L65
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GoogleResourceOwner.php
GoogleResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://accounts.google.com/o/oauth2/auth', 'access_token_url' => 'https://accounts.google.com/o/oauth2/token', ...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://accounts.google.com/o/oauth2/auth', 'access_token_url' => 'https://accounts.google.com/o/oauth2/token', ...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'authorization_url'", "=>", "'https://accounts.google...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GoogleResourceOwner.php#L70-L102
hwi/HWIOAuthBundle
OAuth/ResourceOwner/JawboneResourceOwner.php
JawboneResourceOwner.getInformation
public function getInformation($accessToken, $type, array $extraParameters = []) { $url = $this->normalizeUrl($this->options['infos_url'].'/'.$type, $extraParameters); $headers = [ 'Authorization' => 'Bearer '.$accessToken['access_token'], 'Accept' => 'application/json', ...
php
public function getInformation($accessToken, $type, array $extraParameters = []) { $url = $this->normalizeUrl($this->options['infos_url'].'/'.$type, $extraParameters); $headers = [ 'Authorization' => 'Bearer '.$accessToken['access_token'], 'Accept' => 'application/json', ...
[ "public", "function", "getInformation", "(", "$", "accessToken", ",", "$", "type", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "url", "=", "$", "this", "->", "normalizeUrl", "(", "$", "this", "->", "options", "[", "'infos_url'", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/JawboneResourceOwner.php#L46-L56
hwi/HWIOAuthBundle
OAuth/ResourceOwner/SensioConnectResourceOwner.php
SensioConnectResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://connect.symfony.com/oauth/authorize', 'access_token_url' => 'https://connect.symfony.com/oauth/access_token', ...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://connect.symfony.com/oauth/authorize', 'access_token_url' => 'https://connect.symfony.com/oauth/access_token', ...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'authorization_url'", "=>", "'https://connect.symfony...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/SensioConnectResourceOwner.php#L43-L58
hwi/HWIOAuthBundle
OAuth/RequestDataStorage/SessionStorage.php
SessionStorage.fetch
public function fetch(ResourceOwnerInterface $resourceOwner, $key, $type = 'token') { $key = $this->generateKey($resourceOwner, $key, $type); if (null === $token = $this->session->get($key)) { throw new \InvalidArgumentException('No data available in storage.'); } // req...
php
public function fetch(ResourceOwnerInterface $resourceOwner, $key, $type = 'token') { $key = $this->generateKey($resourceOwner, $key, $type); if (null === $token = $this->session->get($key)) { throw new \InvalidArgumentException('No data available in storage.'); } // req...
[ "public", "function", "fetch", "(", "ResourceOwnerInterface", "$", "resourceOwner", ",", "$", "key", ",", "$", "type", "=", "'token'", ")", "{", "$", "key", "=", "$", "this", "->", "generateKey", "(", "$", "resourceOwner", ",", "$", "key", ",", "$", "t...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/RequestDataStorage/SessionStorage.php#L43-L54
hwi/HWIOAuthBundle
OAuth/RequestDataStorage/SessionStorage.php
SessionStorage.save
public function save(ResourceOwnerInterface $resourceOwner, $value, $type = 'token') { if ('token' === $type) { if (!\is_array($value) || !isset($value['oauth_token'])) { throw new \InvalidArgumentException('Invalid request token.'); } $key = $this->gener...
php
public function save(ResourceOwnerInterface $resourceOwner, $value, $type = 'token') { if ('token' === $type) { if (!\is_array($value) || !isset($value['oauth_token'])) { throw new \InvalidArgumentException('Invalid request token.'); } $key = $this->gener...
[ "public", "function", "save", "(", "ResourceOwnerInterface", "$", "resourceOwner", ",", "$", "value", ",", "$", "type", "=", "'token'", ")", "{", "if", "(", "'token'", "===", "$", "type", ")", "{", "if", "(", "!", "\\", "is_array", "(", "$", "value", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/RequestDataStorage/SessionStorage.php#L59-L72
hwi/HWIOAuthBundle
OAuth/RequestDataStorage/SessionStorage.php
SessionStorage.generateKey
protected function generateKey(ResourceOwnerInterface $resourceOwner, $key, $type) { return sprintf('_hwi_oauth.%s.%s.%s.%s', $resourceOwner->getName(), $resourceOwner->getOption('client_id'), $type, $key); }
php
protected function generateKey(ResourceOwnerInterface $resourceOwner, $key, $type) { return sprintf('_hwi_oauth.%s.%s.%s.%s', $resourceOwner->getName(), $resourceOwner->getOption('client_id'), $type, $key); }
[ "protected", "function", "generateKey", "(", "ResourceOwnerInterface", "$", "resourceOwner", ",", "$", "key", ",", "$", "type", ")", "{", "return", "sprintf", "(", "'_hwi_oauth.%s.%s.%s.%s'", ",", "$", "resourceOwner", "->", "getName", "(", ")", ",", "$", "res...
Key to for fetching or saving a token. @param ResourceOwnerInterface $resourceOwner @param string $key @param string $type @return string
[ "Key", "to", "for", "fetching", "or", "saving", "a", "token", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/RequestDataStorage/SessionStorage.php#L83-L86
hwi/HWIOAuthBundle
Form/FOSUBRegistrationFormHandler.php
FOSUBRegistrationFormHandler.process
public function process(Request $request, Form $form, UserResponseInterface $userInformation) { $user = $this->userManager->createUser(); $user->setEnabled(true); $form->setData($this->setUserInformation($user, $userInformation)); if ($request->isMethod('POST')) { $form...
php
public function process(Request $request, Form $form, UserResponseInterface $userInformation) { $user = $this->userManager->createUser(); $user->setEnabled(true); $form->setData($this->setUserInformation($user, $userInformation)); if ($request->isMethod('POST')) { $form...
[ "public", "function", "process", "(", "Request", "$", "request", ",", "Form", "$", "form", ",", "UserResponseInterface", "$", "userInformation", ")", "{", "$", "user", "=", "$", "this", "->", "userManager", "->", "createUser", "(", ")", ";", "$", "user", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Form/FOSUBRegistrationFormHandler.php#L65-L79
hwi/HWIOAuthBundle
Form/FOSUBRegistrationFormHandler.php
FOSUBRegistrationFormHandler.getUniqueUserName
protected function getUniqueUserName($name) { $i = 0; $testName = $name; do { $user = $this->userManager->findUserByUsername($testName); } while (null !== $user && $i < $this->iterations && $testName = $name.++$i); return null !== $user ? '' : $testName; }
php
protected function getUniqueUserName($name) { $i = 0; $testName = $name; do { $user = $this->userManager->findUserByUsername($testName); } while (null !== $user && $i < $this->iterations && $testName = $name.++$i); return null !== $user ? '' : $testName; }
[ "protected", "function", "getUniqueUserName", "(", "$", "name", ")", "{", "$", "i", "=", "0", ";", "$", "testName", "=", "$", "name", ";", "do", "{", "$", "user", "=", "$", "this", "->", "userManager", "->", "findUserByUsername", "(", "$", "testName", ...
Attempts to get a unique username for the user. @param string $name @return string name, or empty string if it failed after all the iterations
[ "Attempts", "to", "get", "a", "unique", "username", "for", "the", "user", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Form/FOSUBRegistrationFormHandler.php#L88-L98
hwi/HWIOAuthBundle
Form/FOSUBRegistrationFormHandler.php
FOSUBRegistrationFormHandler.setUserInformation
protected function setUserInformation(UserInterface $user, UserResponseInterface $userInformation) { $accessor = PropertyAccess::createPropertyAccessor(); $accessor->setValue($user, 'username', $this->getUniqueUserName($userInformation->getNickname())); if (method_exists($accessor, 'isWrita...
php
protected function setUserInformation(UserInterface $user, UserResponseInterface $userInformation) { $accessor = PropertyAccess::createPropertyAccessor(); $accessor->setValue($user, 'username', $this->getUniqueUserName($userInformation->getNickname())); if (method_exists($accessor, 'isWrita...
[ "protected", "function", "setUserInformation", "(", "UserInterface", "$", "user", ",", "UserResponseInterface", "$", "userInformation", ")", "{", "$", "accessor", "=", "PropertyAccess", "::", "createPropertyAccessor", "(", ")", ";", "$", "accessor", "->", "setValue"...
Set user information from form. @param UserInterface $user @param UserResponseInterface $userInformation @return UserInterface
[ "Set", "user", "information", "from", "form", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Form/FOSUBRegistrationFormHandler.php#L108-L120
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FoursquareResourceOwner.php
FoursquareResourceOwner.getResponseContent
protected function getResponseContent(ResponseInterface $rawResponse) { $response = parent::getResponseContent($rawResponse); // Foursquare use quite custom response structure in case of error if (isset($response['meta']['errorType'])) { // Prevent to mark deprecated calls as er...
php
protected function getResponseContent(ResponseInterface $rawResponse) { $response = parent::getResponseContent($rawResponse); // Foursquare use quite custom response structure in case of error if (isset($response['meta']['errorType'])) { // Prevent to mark deprecated calls as er...
[ "protected", "function", "getResponseContent", "(", "ResponseInterface", "$", "rawResponse", ")", "{", "$", "response", "=", "parent", "::", "getResponseContent", "(", "$", "rawResponse", ")", ";", "// Foursquare use quite custom response structure in case of error", "if", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FoursquareResourceOwner.php#L40-L61
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FoursquareResourceOwner.php
FoursquareResourceOwner.doGetUserInformationRequest
protected function doGetUserInformationRequest($url, array $parameters = []) { // Foursquare require to pass the 'v' ('version' = date in format 'YYYYMMDD') parameter when requesting API $url = $this->normalizeUrl($url, [ 'v' => $this->options['version'], ]); // Foursqua...
php
protected function doGetUserInformationRequest($url, array $parameters = []) { // Foursquare require to pass the 'v' ('version' = date in format 'YYYYMMDD') parameter when requesting API $url = $this->normalizeUrl($url, [ 'v' => $this->options['version'], ]); // Foursqua...
[ "protected", "function", "doGetUserInformationRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "// Foursquare require to pass the 'v' ('version' = date in format 'YYYYMMDD') parameter when requesting API", "$", "url", "=", "$", "this", "-...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FoursquareResourceOwner.php#L66-L77
hwi/HWIOAuthBundle
OAuth/Response/AbstractUserResponse.php
AbstractUserResponse.setData
public function setData($data) { if (\is_array($data)) { $this->data = $data; } else { // First check that response exists, due too bug: https://bugs.php.net/bug.php?id=54484 if (!$data) { $this->data = []; } else { $thi...
php
public function setData($data) { if (\is_array($data)) { $this->data = $data; } else { // First check that response exists, due too bug: https://bugs.php.net/bug.php?id=54484 if (!$data) { $this->data = []; } else { $thi...
[ "public", "function", "setData", "(", "$", "data", ")", "{", "if", "(", "\\", "is_array", "(", "$", "data", ")", ")", "{", "$", "this", "->", "data", "=", "$", "data", ";", "}", "else", "{", "// First check that response exists, due too bug: https://bugs.php...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/AbstractUserResponse.php#L113-L129
hwi/HWIOAuthBundle
OAuth/ResourceOwner/TwitterResourceOwner.php
TwitterResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { if ($this->options['include_email']) { $this->options['infos_url'] = $this->normalizeUrl($this->options['infos_url'], ['include_email' => 'true']); } return parent::getUserInformation($accessTo...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { if ($this->options['include_email']) { $this->options['infos_url'] = $this->normalizeUrl($this->options['infos_url'], ['include_email' => 'true']); } return parent::getUserInformation($accessTo...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "options", "[", "'include_email'", "]", ")", "{", "$", "this", "->", "options", "["...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/TwitterResourceOwner.php#L37-L44
hwi/HWIOAuthBundle
OAuth/ResourceOwner/TwitterResourceOwner.php
TwitterResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://api.twitter.com/oauth/authenticate', 'request_token_url' => 'https://api.twitter.com/oauth/request_token', ...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://api.twitter.com/oauth/authenticate', 'request_token_url' => 'https://api.twitter.com/oauth/request_token', ...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'authorization_url'", "=>", "'https://api.twitter.com...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/TwitterResourceOwner.php#L49-L66
hwi/HWIOAuthBundle
OAuth/ResourceOwner/QQResourceOwner.php
QQResourceOwner.getResponseContent
public function getResponseContent(ResponseInterface $rawResponse) { $content = (string) $rawResponse->getBody(); if (preg_match('/^callback\((.+)\);$/', $content, $matches)) { $rawResponse = MessageFactoryDiscovery::find() ->createResponse( $rawRespon...
php
public function getResponseContent(ResponseInterface $rawResponse) { $content = (string) $rawResponse->getBody(); if (preg_match('/^callback\((.+)\);$/', $content, $matches)) { $rawResponse = MessageFactoryDiscovery::find() ->createResponse( $rawRespon...
[ "public", "function", "getResponseContent", "(", "ResponseInterface", "$", "rawResponse", ")", "{", "$", "content", "=", "(", "string", ")", "$", "rawResponse", "->", "getBody", "(", ")", ";", "if", "(", "preg_match", "(", "'/^callback\\((.+)\\);$/'", ",", "$"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/QQResourceOwner.php#L35-L50
hwi/HWIOAuthBundle
OAuth/ResourceOwner/QQResourceOwner.php
QQResourceOwner.getUserInformation
public function getUserInformation(array $accessToken = null, array $extraParameters = []) { $openid = $extraParameters['openid'] ?? $this->requestUserIdentifier($accessToken); $url = $this->normalizeUrl($this->options['infos_url'], [ 'oauth_consumer_key' => $this->options['client_id'],...
php
public function getUserInformation(array $accessToken = null, array $extraParameters = []) { $openid = $extraParameters['openid'] ?? $this->requestUserIdentifier($accessToken); $url = $this->normalizeUrl($this->options['infos_url'], [ 'oauth_consumer_key' => $this->options['client_id'],...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", "=", "null", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "openid", "=", "$", "extraParameters", "[", "'openid'", "]", "??", "$", "this", "->", "requestUse...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/QQResourceOwner.php#L55-L82
hwi/HWIOAuthBundle
Templating/Helper/OAuthHelper.php
OAuthHelper.getAuthorizationUrl
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = []) { return $this->oauthUtils->getAuthorizationUrl($this->requestStack->getMasterRequest(), $name, $redirectUrl, $extraParameters); }
php
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = []) { return $this->oauthUtils->getAuthorizationUrl($this->requestStack->getMasterRequest(), $name, $redirectUrl, $extraParameters); }
[ "public", "function", "getAuthorizationUrl", "(", "$", "name", ",", "$", "redirectUrl", "=", "null", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "oauthUtils", "->", "getAuthorizationUrl", "(", "$", "this", "-...
@param string $name @param string $redirectUrl Optional @param array $extraParameters Optional @return string
[ "@param", "string", "$name", "@param", "string", "$redirectUrl", "Optional", "@param", "array", "$extraParameters", "Optional" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Templating/Helper/OAuthHelper.php#L71-L74
hwi/HWIOAuthBundle
OAuth/ResourceOwner/ItembaseResourceOwner.php
ItembaseResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => self::ITEMBASE_AUTH_URL, 'access_token_url' => self::ITEMBASE_TOKEN_URL, 'infos_url' => self::ITEMBASE_INFOS_URL,...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => self::ITEMBASE_AUTH_URL, 'access_token_url' => self::ITEMBASE_TOKEN_URL, 'infos_url' => self::ITEMBASE_INFOS_URL,...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'authorization_url'", "=>", "self", "::", "ITEMBA...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/ItembaseResourceOwner.php#L41-L50
hwi/HWIOAuthBundle
DependencyInjection/CompilerPass/SetResourceOwnerServiceNameCompilerPass.php
SetResourceOwnerServiceNameCompilerPass.process
public function process(ContainerBuilder $container) { foreach (array_keys($container->getAliases()) as $alias) { if (0 !== strpos($alias, 'hwi_oauth.resource_owner.')) { continue; } $aliasIdParts = explode('.', $alias); $resourceOwnerDefiniti...
php
public function process(ContainerBuilder $container) { foreach (array_keys($container->getAliases()) as $alias) { if (0 !== strpos($alias, 'hwi_oauth.resource_owner.')) { continue; } $aliasIdParts = explode('.', $alias); $resourceOwnerDefiniti...
[ "public", "function", "process", "(", "ContainerBuilder", "$", "container", ")", "{", "foreach", "(", "array_keys", "(", "$", "container", "->", "getAliases", "(", ")", ")", "as", "$", "alias", ")", "{", "if", "(", "0", "!==", "strpos", "(", "$", "alia...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/CompilerPass/SetResourceOwnerServiceNameCompilerPass.php#L27-L38
hwi/HWIOAuthBundle
OAuth/ResourceOwner/CleverResourceOwner.php
CleverResourceOwner.doGetTokenRequest
protected function doGetTokenRequest($url, array $parameters = []) { $authPreHash = $this->options['client_id'].':'.$this->options['client_secret']; $authHeader = 'Authorization: Basic '.base64_encode($authPreHash); return $this->httpRequest( $url, http_build_query($...
php
protected function doGetTokenRequest($url, array $parameters = []) { $authPreHash = $this->options['client_id'].':'.$this->options['client_secret']; $authHeader = 'Authorization: Basic '.base64_encode($authPreHash); return $this->httpRequest( $url, http_build_query($...
[ "protected", "function", "doGetTokenRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "$", "authPreHash", "=", "$", "this", "->", "options", "[", "'client_id'", "]", ".", "':'", ".", "$", "this", "->", "options", "[",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/CleverResourceOwner.php#L55-L67
hwi/HWIOAuthBundle
OAuth/ResourceOwner/RedditResourceOwner.php
RedditResourceOwner.doGetTokenRequest
protected function doGetTokenRequest($url, array $parameters = []) { return $this->httpRequest( $url, http_build_query($parameters, '', '&'), [ 'Authorization' => 'Basic '.base64_encode(sprintf('%s:%s', $this->options['client_id'], $this->options['client_s...
php
protected function doGetTokenRequest($url, array $parameters = []) { return $this->httpRequest( $url, http_build_query($parameters, '', '&'), [ 'Authorization' => 'Basic '.base64_encode(sprintf('%s:%s', $this->options['client_id'], $this->options['client_s...
[ "protected", "function", "doGetTokenRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "httpRequest", "(", "$", "url", ",", "http_build_query", "(", "$", "parameters", ",", "''", ",", "'&'", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/RedditResourceOwner.php#L34-L44
hwi/HWIOAuthBundle
OAuth/ResourceOwner/DisqusResourceOwner.php
DisqusResourceOwner.doGetUserInformationRequest
protected function doGetUserInformationRequest($url, array $parameters = []) { // Disqus requires api key and secret for user information requests $url = $this->normalizeUrl($url, [ 'api_key' => $this->options['client_id'], 'api_secret' => $this->options['client_secret'], ...
php
protected function doGetUserInformationRequest($url, array $parameters = []) { // Disqus requires api key and secret for user information requests $url = $this->normalizeUrl($url, [ 'api_key' => $this->options['client_id'], 'api_secret' => $this->options['client_secret'], ...
[ "protected", "function", "doGetUserInformationRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "// Disqus requires api key and secret for user information requests", "$", "url", "=", "$", "this", "->", "normalizeUrl", "(", "$", "u...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/DisqusResourceOwner.php#L35-L44
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FacebookResourceOwner.php
FacebookResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { if ($this->options['appsecret_proof']) { $extraParameters['appsecret_proof'] = hash_hmac('sha256', $accessToken['access_token'], $this->options['client_secret']); } return parent::getUserInform...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { if ($this->options['appsecret_proof']) { $extraParameters['appsecret_proof'] = hash_hmac('sha256', $accessToken['access_token'], $this->options['client_secret']); } return parent::getUserInform...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "options", "[", "'appsecret_proof'", "]", ")", "{", "$", "extraParameters", "[", "'ap...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FacebookResourceOwner.php#L40-L47
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FacebookResourceOwner.php
FacebookResourceOwner.getAuthorizationUrl
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { $extraOptions = []; if (isset($this->options['display'])) { $extraOptions['display'] = $this->options['display']; } if (isset($this->options['auth_type'])) { $extraOptions['auth_...
php
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { $extraOptions = []; if (isset($this->options['display'])) { $extraOptions['display'] = $this->options['display']; } if (isset($this->options['auth_type'])) { $extraOptions['auth_...
[ "public", "function", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "extraOptions", "=", "[", "]", ";", "if", "(", "isset", "(", "$", "this", "->", "options", "[", "'display'", "]", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FacebookResourceOwner.php#L52-L64
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FacebookResourceOwner.php
FacebookResourceOwner.getAccessToken
public function getAccessToken(Request $request, $redirectUri, array $extraParameters = []) { $parameters = []; if ($request->query->has('fb_source')) { $parameters['fb_source'] = $request->query->get('fb_source'); } if ($request->query->has('fb_appcenter')) { ...
php
public function getAccessToken(Request $request, $redirectUri, array $extraParameters = []) { $parameters = []; if ($request->query->has('fb_source')) { $parameters['fb_source'] = $request->query->get('fb_source'); } if ($request->query->has('fb_appcenter')) { ...
[ "public", "function", "getAccessToken", "(", "Request", "$", "request", ",", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "parameters", "=", "[", "]", ";", "if", "(", "$", "request", "->", "query", "->", "has"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FacebookResourceOwner.php#L69-L81
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FacebookResourceOwner.php
FacebookResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://www.facebook.com/v3.1/dialog/oauth', 'access_token_url' => 'https://graph.facebook.com/v3.1/oauth/access_token', ...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://www.facebook.com/v3.1/dialog/oauth', 'access_token_url' => 'https://graph.facebook.com/v3.1/oauth/access_token', ...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'authorization_url'", "=>", "'https://www.facebook.co...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FacebookResourceOwner.php#L101-L121
hwi/HWIOAuthBundle
OAuth/ResourceOwner/YahooResourceOwner.php
YahooResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $this->options['infos_url'] = str_replace('{guid}', $accessToken['xoauth_yahoo_guid'], $this->options['infos_url']); return parent::getUserInformation($accessToken, $extraParameters); }
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $this->options['infos_url'] = str_replace('{guid}', $accessToken['xoauth_yahoo_guid'], $this->options['infos_url']); return parent::getUserInformation($accessToken, $extraParameters); }
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "this", "->", "options", "[", "'infos_url'", "]", "=", "str_replace", "(", "'{guid}'", ",", "$", "accessToken", ...
Override to replace {guid} in the infos_url with the authenticating user's yahoo id. {@inheritdoc}
[ "Override", "to", "replace", "{", "guid", "}", "in", "the", "infos_url", "with", "the", "authenticating", "user", "s", "yahoo", "id", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/YahooResourceOwner.php#L38-L43
hwi/HWIOAuthBundle
OAuth/ResourceOwner/OdnoklassnikiResourceOwner.php
OdnoklassnikiResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $parameters = [ 'access_token' => $accessToken['access_token'], 'application_key' => $this->options['application_key'], ]; if ($this->options['fields']) { $parameters['f...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $parameters = [ 'access_token' => $accessToken['access_token'], 'application_key' => $this->options['application_key'], ]; if ($this->options['fields']) { $parameters['f...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "parameters", "=", "[", "'access_token'", "=>", "$", "accessToken", "[", "'access_token'", "]", ",", "'application...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/OdnoklassnikiResourceOwner.php#L40-L72
hwi/HWIOAuthBundle
OAuth/ResourceOwner/OdnoklassnikiResourceOwner.php
OdnoklassnikiResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://connect.ok.ru/oauth/authorize', 'access_token_url' => 'https://api.ok.ru/oauth/token.do', 'infos_url' =>...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'authorization_url' => 'https://connect.ok.ru/oauth/authorize', 'access_token_url' => 'https://api.ok.ru/oauth/token.do', 'infos_url' =>...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'authorization_url'", "=>", "'https://connect.ok.ru/o...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/OdnoklassnikiResourceOwner.php#L77-L99
hwi/HWIOAuthBundle
Security/Core/User/FOSUBUserProvider.php
FOSUBUserProvider.loadUserByOAuthUserResponse
public function loadUserByOAuthUserResponse(UserResponseInterface $response) { $username = $response->getUsername(); $user = $this->userManager->findUserBy([$this->getProperty($response) => $username]); if (null === $user || null === $username) { throw new AccountNotLinkedExcept...
php
public function loadUserByOAuthUserResponse(UserResponseInterface $response) { $username = $response->getUsername(); $user = $this->userManager->findUserBy([$this->getProperty($response) => $username]); if (null === $user || null === $username) { throw new AccountNotLinkedExcept...
[ "public", "function", "loadUserByOAuthUserResponse", "(", "UserResponseInterface", "$", "response", ")", "{", "$", "username", "=", "$", "response", "->", "getUsername", "(", ")", ";", "$", "user", "=", "$", "this", "->", "userManager", "->", "findUserBy", "("...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/FOSUBUserProvider.php#L77-L87
hwi/HWIOAuthBundle
Security/Core/User/FOSUBUserProvider.php
FOSUBUserProvider.connect
public function connect(UserInterface $user, UserResponseInterface $response) { if (!$user instanceof User) { throw new UnsupportedUserException(sprintf('Expected an instance of FOS\UserBundle\Model\User, but got "%s".', \get_class($user))); } $property = $this->getProperty($res...
php
public function connect(UserInterface $user, UserResponseInterface $response) { if (!$user instanceof User) { throw new UnsupportedUserException(sprintf('Expected an instance of FOS\UserBundle\Model\User, but got "%s".', \get_class($user))); } $property = $this->getProperty($res...
[ "public", "function", "connect", "(", "UserInterface", "$", "user", ",", "UserResponseInterface", "$", "response", ")", "{", "if", "(", "!", "$", "user", "instanceof", "User", ")", "{", "throw", "new", "UnsupportedUserException", "(", "sprintf", "(", "'Expecte...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/FOSUBUserProvider.php#L92-L112
hwi/HWIOAuthBundle
Security/Core/User/FOSUBUserProvider.php
FOSUBUserProvider.disconnect
public function disconnect(UserInterface $user, UserResponseInterface $response) { $property = $this->getProperty($response); $this->accessor->setValue($user, $property, null); $this->userManager->updateUser($user); }
php
public function disconnect(UserInterface $user, UserResponseInterface $response) { $property = $this->getProperty($response); $this->accessor->setValue($user, $property, null); $this->userManager->updateUser($user); }
[ "public", "function", "disconnect", "(", "UserInterface", "$", "user", ",", "UserResponseInterface", "$", "response", ")", "{", "$", "property", "=", "$", "this", "->", "getProperty", "(", "$", "response", ")", ";", "$", "this", "->", "accessor", "->", "se...
Disconnects a user. @param UserInterface $user @param UserResponseInterface $response
[ "Disconnects", "a", "user", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/FOSUBUserProvider.php#L120-L126
hwi/HWIOAuthBundle
Security/Core/User/FOSUBUserProvider.php
FOSUBUserProvider.refreshUser
public function refreshUser(UserInterface $user) { $identifier = $this->properties['identifier']; if (!$user instanceof User || !$this->accessor->isReadable($user, $identifier)) { throw new UnsupportedUserException(sprintf('Expected an instance of FOS\UserBundle\Model\User, but got "%s"....
php
public function refreshUser(UserInterface $user) { $identifier = $this->properties['identifier']; if (!$user instanceof User || !$this->accessor->isReadable($user, $identifier)) { throw new UnsupportedUserException(sprintf('Expected an instance of FOS\UserBundle\Model\User, but got "%s"....
[ "public", "function", "refreshUser", "(", "UserInterface", "$", "user", ")", "{", "$", "identifier", "=", "$", "this", "->", "properties", "[", "'identifier'", "]", ";", "if", "(", "!", "$", "user", "instanceof", "User", "||", "!", "$", "this", "->", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/FOSUBUserProvider.php#L131-L144
hwi/HWIOAuthBundle
Security/Core/User/FOSUBUserProvider.php
FOSUBUserProvider.getProperty
protected function getProperty(UserResponseInterface $response) { $resourceOwnerName = $response->getResourceOwner()->getName(); if (!isset($this->properties[$resourceOwnerName])) { throw new \RuntimeException(sprintf("No property defined for entity for resource owner '%s'.", $resourceO...
php
protected function getProperty(UserResponseInterface $response) { $resourceOwnerName = $response->getResourceOwner()->getName(); if (!isset($this->properties[$resourceOwnerName])) { throw new \RuntimeException(sprintf("No property defined for entity for resource owner '%s'.", $resourceO...
[ "protected", "function", "getProperty", "(", "UserResponseInterface", "$", "response", ")", "{", "$", "resourceOwnerName", "=", "$", "response", "->", "getResourceOwner", "(", ")", "->", "getName", "(", ")", ";", "if", "(", "!", "isset", "(", "$", "this", ...
Gets the property for the response. @param UserResponseInterface $response @return string @throws \RuntimeException
[ "Gets", "the", "property", "for", "the", "response", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/FOSUBUserProvider.php#L165-L174
hwi/HWIOAuthBundle
Security/Core/Authentication/Provider/OAuthProvider.php
OAuthProvider.supports
public function supports(TokenInterface $token) { return $token instanceof OAuthToken && $this->resourceOwnerMap->hasResourceOwnerByName($token->getResourceOwnerName()) ; }
php
public function supports(TokenInterface $token) { return $token instanceof OAuthToken && $this->resourceOwnerMap->hasResourceOwnerByName($token->getResourceOwnerName()) ; }
[ "public", "function", "supports", "(", "TokenInterface", "$", "token", ")", "{", "return", "$", "token", "instanceof", "OAuthToken", "&&", "$", "this", "->", "resourceOwnerMap", "->", "hasResourceOwnerByName", "(", "$", "token", "->", "getResourceOwnerName", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Authentication/Provider/OAuthProvider.php#L71-L77
hwi/HWIOAuthBundle
Security/Core/Authentication/Provider/OAuthProvider.php
OAuthProvider.authenticate
public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { return; } // fix connect to external social very time if ($token->isAuthenticated()) { return $token; } /* @var OAuthToken $token */ $resourceOwner ...
php
public function authenticate(TokenInterface $token) { if (!$this->supports($token)) { return; } // fix connect to external social very time if ($token->isAuthenticated()) { return $token; } /* @var OAuthToken $token */ $resourceOwner ...
[ "public", "function", "authenticate", "(", "TokenInterface", "$", "token", ")", "{", "if", "(", "!", "$", "this", "->", "supports", "(", "$", "token", ")", ")", "{", "return", ";", "}", "// fix connect to external social very time", "if", "(", "$", "token", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Authentication/Provider/OAuthProvider.php#L82-L123
hwi/HWIOAuthBundle
Security/Core/Authentication/Provider/OAuthProvider.php
OAuthProvider.refreshToken
protected function refreshToken(TokenInterface $expiredToken, ResourceOwnerInterface $resourceOwner) { if (!$expiredToken->getRefreshToken()) { return $expiredToken; } $token = new OAuthToken($resourceOwner->refreshAccessToken($expiredToken->getRefreshToken())); $token->...
php
protected function refreshToken(TokenInterface $expiredToken, ResourceOwnerInterface $resourceOwner) { if (!$expiredToken->getRefreshToken()) { return $expiredToken; } $token = new OAuthToken($resourceOwner->refreshAccessToken($expiredToken->getRefreshToken())); $token->...
[ "protected", "function", "refreshToken", "(", "TokenInterface", "$", "expiredToken", ",", "ResourceOwnerInterface", "$", "resourceOwner", ")", "{", "if", "(", "!", "$", "expiredToken", "->", "getRefreshToken", "(", ")", ")", "{", "return", "$", "expiredToken", "...
@param TokenInterface $expiredToken @param ResourceOwnerInterface $resourceOwner @return OAuthToken|TokenInterface
[ "@param", "TokenInterface", "$expiredToken", "@param", "ResourceOwnerInterface", "$resourceOwner" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/Authentication/Provider/OAuthProvider.php#L131-L142
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
GenericOAuth2ResourceOwner.getAuthorizationUrl
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { if ($this->options['csrf']) { if (null === $this->state) { $this->state = $this->generateNonce(); } $this->storage->save($this, $this->state, 'csrf_state'); } ...
php
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { if ($this->options['csrf']) { if (null === $this->state) { $this->state = $this->generateNonce(); } $this->storage->save($this, $this->state, 'csrf_state'); } ...
[ "public", "function", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "if", "(", "$", "this", "->", "options", "[", "'csrf'", "]", ")", "{", "if", "(", "null", "===", "$", "this", "->", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php#L59-L78
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
GenericOAuth2ResourceOwner.getAccessToken
public function getAccessToken(HttpRequest $request, $redirectUri, array $extraParameters = []) { OAuthErrorHandler::handleOAuthError($request); $parameters = array_merge([ 'code' => $request->query->get('code'), 'grant_type' => 'authorization_code', 'client_id' ...
php
public function getAccessToken(HttpRequest $request, $redirectUri, array $extraParameters = []) { OAuthErrorHandler::handleOAuthError($request); $parameters = array_merge([ 'code' => $request->query->get('code'), 'grant_type' => 'authorization_code', 'client_id' ...
[ "public", "function", "getAccessToken", "(", "HttpRequest", "$", "request", ",", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "OAuthErrorHandler", "::", "handleOAuthError", "(", "$", "request", ")", ";", "$", "parameters",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php#L83-L101
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
GenericOAuth2ResourceOwner.refreshAccessToken
public function refreshAccessToken($refreshToken, array $extraParameters = []) { $parameters = array_merge([ 'refresh_token' => $refreshToken, 'grant_type' => 'refresh_token', 'client_id' => $this->options['client_id'], 'client_secret' => $this->options['clien...
php
public function refreshAccessToken($refreshToken, array $extraParameters = []) { $parameters = array_merge([ 'refresh_token' => $refreshToken, 'grant_type' => 'refresh_token', 'client_id' => $this->options['client_id'], 'client_secret' => $this->options['clien...
[ "public", "function", "refreshAccessToken", "(", "$", "refreshToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "parameters", "=", "array_merge", "(", "[", "'refresh_token'", "=>", "$", "refreshToken", ",", "'grant_type'", "=>", "'ref...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php#L106-L121
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
GenericOAuth2ResourceOwner.isCsrfTokenValid
public function isCsrfTokenValid($csrfToken) { // Mark token valid when validation is disabled if (!$this->options['csrf']) { return true; } try { return null !== $this->storage->fetch($this, urldecode($csrfToken), 'csrf_state'); } catch (\InvalidArgu...
php
public function isCsrfTokenValid($csrfToken) { // Mark token valid when validation is disabled if (!$this->options['csrf']) { return true; } try { return null !== $this->storage->fetch($this, urldecode($csrfToken), 'csrf_state'); } catch (\InvalidArgu...
[ "public", "function", "isCsrfTokenValid", "(", "$", "csrfToken", ")", "{", "// Mark token valid when validation is disabled", "if", "(", "!", "$", "this", "->", "options", "[", "'csrf'", "]", ")", "{", "return", "true", ";", "}", "try", "{", "return", "null", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php#L153-L165
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
GenericOAuth2ResourceOwner.validateResponseContent
protected function validateResponseContent($response) { if (isset($response['error_description'])) { throw new AuthenticationException(sprintf('OAuth error: "%s"', $response['error_description'])); } if (isset($response['error'])) { throw new AuthenticationException(...
php
protected function validateResponseContent($response) { if (isset($response['error_description'])) { throw new AuthenticationException(sprintf('OAuth error: "%s"', $response['error_description'])); } if (isset($response['error'])) { throw new AuthenticationException(...
[ "protected", "function", "validateResponseContent", "(", "$", "response", ")", "{", "if", "(", "isset", "(", "$", "response", "[", "'error_description'", "]", ")", ")", "{", "throw", "new", "AuthenticationException", "(", "sprintf", "(", "'OAuth error: \"%s\"'", ...
@param mixed $response the 'parsed' content based on the response headers @throws AuthenticationException If an OAuth error occurred or no access token is found
[ "@param", "mixed", "$response", "the", "parsed", "content", "based", "on", "the", "response", "headers" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php#L188-L201
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
GenericOAuth2ResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'attr_name' => 'access_token', 'use_commas_in_scope' => false, 'use_bearer_authorization' => true, ]); $resolver->setDe...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $resolver->setDefaults([ 'attr_name' => 'access_token', 'use_commas_in_scope' => false, 'use_bearer_authorization' => true, ]); $resolver->setDe...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "resolver", "->", "setDefaults", "(", "[", "'attr_name'", "=>", "'access_token'", ",", "'use_...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php#L206-L233
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php
GenericOAuth2ResourceOwner.httpRequest
protected function httpRequest($url, $content = null, array $headers = [], $method = null) { $headers += ['Content-Type' => 'application/x-www-form-urlencoded']; return parent::httpRequest($url, $content, $headers, $method); }
php
protected function httpRequest($url, $content = null, array $headers = [], $method = null) { $headers += ['Content-Type' => 'application/x-www-form-urlencoded']; return parent::httpRequest($url, $content, $headers, $method); }
[ "protected", "function", "httpRequest", "(", "$", "url", ",", "$", "content", "=", "null", ",", "array", "$", "headers", "=", "[", "]", ",", "$", "method", "=", "null", ")", "{", "$", "headers", "+=", "[", "'Content-Type'", "=>", "'application/x-www-form...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GenericOAuth2ResourceOwner.php#L238-L243
hwi/HWIOAuthBundle
OAuth/ResourceOwner/Auth0ResourceOwner.php
Auth0ResourceOwner.doGetTokenRequest
protected function doGetTokenRequest($url, array $parameters = []) { return $this->httpRequest( $url, http_build_query($parameters, '', '&'), $this->getRequestHeaders(), 'POST' ); }
php
protected function doGetTokenRequest($url, array $parameters = []) { return $this->httpRequest( $url, http_build_query($parameters, '', '&'), $this->getRequestHeaders(), 'POST' ); }
[ "protected", "function", "doGetTokenRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "httpRequest", "(", "$", "url", ",", "http_build_query", "(", "$", "parameters", ",", "''", ",", "'&'", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/Auth0ResourceOwner.php#L38-L46
hwi/HWIOAuthBundle
OAuth/ResourceOwner/Auth0ResourceOwner.php
Auth0ResourceOwner.doGetUserInformationRequest
protected function doGetUserInformationRequest($url, array $parameters = []) { return $this->httpRequest( $url, http_build_query($parameters, '', '&'), $this->getRequestHeaders() ); }
php
protected function doGetUserInformationRequest($url, array $parameters = []) { return $this->httpRequest( $url, http_build_query($parameters, '', '&'), $this->getRequestHeaders() ); }
[ "protected", "function", "doGetUserInformationRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "httpRequest", "(", "$", "url", ",", "http_build_query", "(", "$", "parameters", ",", "''", ",",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/Auth0ResourceOwner.php#L51-L58
hwi/HWIOAuthBundle
OAuth/ResourceOwner/Auth0ResourceOwner.php
Auth0ResourceOwner.configureOptions
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $auth0Client = base64_encode(json_encode([ 'name' => 'HWIOAuthBundle', 'version' => 'unknown', 'environment' => [ 'name' => 'PHP', ...
php
protected function configureOptions(OptionsResolver $resolver) { parent::configureOptions($resolver); $auth0Client = base64_encode(json_encode([ 'name' => 'HWIOAuthBundle', 'version' => 'unknown', 'environment' => [ 'name' => 'PHP', ...
[ "protected", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", "{", "parent", "::", "configureOptions", "(", "$", "resolver", ")", ";", "$", "auth0Client", "=", "base64_encode", "(", "json_encode", "(", "[", "'name'", "=>", "'HWIOAuth...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/Auth0ResourceOwner.php#L63-L94
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GitHubResourceOwner.php
GitHubResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $response = parent::getUserInformation($accessToken, $extraParameters); $responseData = $response->getData(); if (empty($responseData['email'])) { // fetch the email addresses linked to the acc...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $response = parent::getUserInformation($accessToken, $extraParameters); $responseData = $response->getData(); if (empty($responseData['email'])) { // fetch the email addresses linked to the acc...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "response", "=", "parent", "::", "getUserInformation", "(", "$", "accessToken", ",", "$", "extraParameters", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GitHubResourceOwner.php#L38-L61
hwi/HWIOAuthBundle
OAuth/ResourceOwner/GitHubResourceOwner.php
GitHubResourceOwner.revokeToken
public function revokeToken($token) { $response = $this->httpRequest( sprintf($this->options['revoke_token_url'], $this->options['client_id'], $token), null, ['Authorization' => 'Basic '.base64_encode($this->options['client_id'].':'.$this->options['client_secret'])], ...
php
public function revokeToken($token) { $response = $this->httpRequest( sprintf($this->options['revoke_token_url'], $this->options['client_id'], $token), null, ['Authorization' => 'Basic '.base64_encode($this->options['client_id'].':'.$this->options['client_secret'])], ...
[ "public", "function", "revokeToken", "(", "$", "token", ")", "{", "$", "response", "=", "$", "this", "->", "httpRequest", "(", "sprintf", "(", "$", "this", "->", "options", "[", "'revoke_token_url'", "]", ",", "$", "this", "->", "options", "[", "'client_...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/GitHubResourceOwner.php#L66-L76
hwi/HWIOAuthBundle
OAuth/ResourceOwner/MailRuResourceOwner.php
MailRuResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $params = [ 'app_id' => $this->options['client_id'], 'method' => 'users.getInfo', 'secure' => '1', 'session_key' => $accessToken['access_token'], ]; $params[...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $params = [ 'app_id' => $this->options['client_id'], 'method' => 'users.getInfo', 'secure' => '1', 'session_key' => $accessToken['access_token'], ]; $params[...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "params", "=", "[", "'app_id'", "=>", "$", "this", "->", "options", "[", "'client_id'", "]", ",", "'method'", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/MailRuResourceOwner.php#L37-L62
hwi/HWIOAuthBundle
DependencyInjection/Configuration.php
Configuration.getResourceOwnerType
public static function getResourceOwnerType($resourceOwner) { $resourceOwner = strtolower($resourceOwner); if ('oauth1' === $resourceOwner || 'oauth2' === $resourceOwner) { return $resourceOwner; } if (\in_array($resourceOwner, static::$resourceOwners['oauth1'], true)) {...
php
public static function getResourceOwnerType($resourceOwner) { $resourceOwner = strtolower($resourceOwner); if ('oauth1' === $resourceOwner || 'oauth2' === $resourceOwner) { return $resourceOwner; } if (\in_array($resourceOwner, static::$resourceOwners['oauth1'], true)) {...
[ "public", "static", "function", "getResourceOwnerType", "(", "$", "resourceOwner", ")", "{", "$", "resourceOwner", "=", "strtolower", "(", "$", "resourceOwner", ")", ";", "if", "(", "'oauth1'", "===", "$", "resourceOwner", "||", "'oauth2'", "===", "$", "resour...
Return the type (OAuth1 or OAuth2) of given resource owner. @param string $resourceOwner @return string
[ "Return", "the", "type", "(", "OAuth1", "or", "OAuth2", ")", "of", "given", "resource", "owner", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Configuration.php#L107-L119
hwi/HWIOAuthBundle
DependencyInjection/Configuration.php
Configuration.isResourceOwnerSupported
public static function isResourceOwnerSupported($resourceOwner) { $resourceOwner = strtolower($resourceOwner); if ('oauth1' === $resourceOwner || 'oauth2' === $resourceOwner) { return true; } if (\in_array($resourceOwner, static::$resourceOwners['oauth1'], true)) { ...
php
public static function isResourceOwnerSupported($resourceOwner) { $resourceOwner = strtolower($resourceOwner); if ('oauth1' === $resourceOwner || 'oauth2' === $resourceOwner) { return true; } if (\in_array($resourceOwner, static::$resourceOwners['oauth1'], true)) { ...
[ "public", "static", "function", "isResourceOwnerSupported", "(", "$", "resourceOwner", ")", "{", "$", "resourceOwner", "=", "strtolower", "(", "$", "resourceOwner", ")", ";", "if", "(", "'oauth1'", "===", "$", "resourceOwner", "||", "'oauth2'", "===", "$", "re...
Checks that given resource owner is supported by this bundle. @param string $resourceOwner @return bool
[ "Checks", "that", "given", "resource", "owner", "is", "supported", "by", "this", "bundle", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Configuration.php#L128-L140
hwi/HWIOAuthBundle
DependencyInjection/Configuration.php
Configuration.getConfigTreeBuilder
public function getConfigTreeBuilder() { $builder = new TreeBuilder('hwi_oauth'); if (method_exists($builder, 'getRootNode')) { $rootNode = $builder->getRootNode(); } else { // BC layer for symfony/config 4.1 and older $rootNode = $builder->root('hwi_oaut...
php
public function getConfigTreeBuilder() { $builder = new TreeBuilder('hwi_oauth'); if (method_exists($builder, 'getRootNode')) { $rootNode = $builder->getRootNode(); } else { // BC layer for symfony/config 4.1 and older $rootNode = $builder->root('hwi_oaut...
[ "public", "function", "getConfigTreeBuilder", "(", ")", "{", "$", "builder", "=", "new", "TreeBuilder", "(", "'hwi_oauth'", ")", ";", "if", "(", "method_exists", "(", "$", "builder", ",", "'getRootNode'", ")", ")", "{", "$", "rootNode", "=", "$", "builder"...
Generates the configuration tree builder. @return TreeBuilder $builder The tree builder
[ "Generates", "the", "configuration", "tree", "builder", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/DependencyInjection/Configuration.php#L147-L188
hwi/HWIOAuthBundle
Twig/Extension/OAuthExtension.php
OAuthExtension.getAuthorizationUrl
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = []) { return $this->helper->getAuthorizationUrl($name, $redirectUrl, $extraParameters); }
php
public function getAuthorizationUrl($name, $redirectUrl = null, array $extraParameters = []) { return $this->helper->getAuthorizationUrl($name, $redirectUrl, $extraParameters); }
[ "public", "function", "getAuthorizationUrl", "(", "$", "name", ",", "$", "redirectUrl", "=", "null", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "helper", "->", "getAuthorizationUrl", "(", "$", "name", ",", ...
@param string $name @param string $redirectUrl Optional @param array $extraParameters Optional @return string
[ "@param", "string", "$name", "@param", "string", "$redirectUrl", "Optional", "@param", "array", "$extraParameters", "Optional" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Twig/Extension/OAuthExtension.php#L75-L78
hwi/HWIOAuthBundle
Security/OAuthErrorHandler.php
OAuthErrorHandler.handleOAuthError
public static function handleOAuthError(Request $request) { $error = null; // Try to parse content if error was not in request query if ($request->query->has('error')) { $content = json_decode($request->getContent(), true); if (isset($content['error']) && JSON_ERROR_...
php
public static function handleOAuthError(Request $request) { $error = null; // Try to parse content if error was not in request query if ($request->query->has('error')) { $content = json_decode($request->getContent(), true); if (isset($content['error']) && JSON_ERROR_...
[ "public", "static", "function", "handleOAuthError", "(", "Request", "$", "request", ")", "{", "$", "error", "=", "null", ";", "// Try to parse content if error was not in request query", "if", "(", "$", "request", "->", "query", "->", "has", "(", "'error'", ")", ...
@param Request $request @throws AuthenticationException
[ "@param", "Request", "$request" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/OAuthErrorHandler.php#L41-L74
hwi/HWIOAuthBundle
OAuth/ResourceOwner/LinkedinResourceOwner.php
LinkedinResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $response = parent::getUserInformation($accessToken, $extraParameters); $responseData = $response->getData(); // The user info returned by /me doesn't contain the email so we make an extra request to fetch...
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $response = parent::getUserInformation($accessToken, $extraParameters); $responseData = $response->getData(); // The user info returned by /me doesn't contain the email so we make an extra request to fetch...
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "response", "=", "parent", "::", "getUserInformation", "(", "$", "accessToken", ",", "$", "extraParameters", ")", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/LinkedinResourceOwner.php#L40-L61
hwi/HWIOAuthBundle
OAuth/ResourceOwner/LinkedinResourceOwner.php
LinkedinResourceOwner.doGetTokenRequest
protected function doGetTokenRequest($url, array $parameters = []) { return $this->httpRequest($this->normalizeUrl($url, $parameters), null, [], 'POST'); }
php
protected function doGetTokenRequest($url, array $parameters = []) { return $this->httpRequest($this->normalizeUrl($url, $parameters), null, [], 'POST'); }
[ "protected", "function", "doGetTokenRequest", "(", "$", "url", ",", "array", "$", "parameters", "=", "[", "]", ")", "{", "return", "$", "this", "->", "httpRequest", "(", "$", "this", "->", "normalizeUrl", "(", "$", "url", ",", "$", "parameters", ")", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/LinkedinResourceOwner.php#L66-L69
hwi/HWIOAuthBundle
OAuth/Response/PathUserResponse.php
PathUserResponse.getPath
public function getPath($name) { return \array_key_exists($name, $this->paths) ? $this->paths[$name] : null; }
php
public function getPath($name) { return \array_key_exists($name, $this->paths) ? $this->paths[$name] : null; }
[ "public", "function", "getPath", "(", "$", "name", ")", "{", "return", "\\", "array_key_exists", "(", "$", "name", ",", "$", "this", "->", "paths", ")", "?", "$", "this", "->", "paths", "[", "$", "name", "]", ":", "null", ";", "}" ]
@param string $name @return array|null
[ "@param", "string", "$name" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/PathUserResponse.php#L117-L120
hwi/HWIOAuthBundle
OAuth/Response/PathUserResponse.php
PathUserResponse.getValueForPath
protected function getValueForPath($path) { $data = $this->data; if (!$data) { return null; } $steps = $this->getPath($path); if (!$steps) { return null; } if (\is_array($steps)) { if (1 === \count($steps)) { ...
php
protected function getValueForPath($path) { $data = $this->data; if (!$data) { return null; } $steps = $this->getPath($path); if (!$steps) { return null; } if (\is_array($steps)) { if (1 === \count($steps)) { ...
[ "protected", "function", "getValueForPath", "(", "$", "path", ")", "{", "$", "data", "=", "$", "this", "->", "data", ";", "if", "(", "!", "$", "data", ")", "{", "return", "null", ";", "}", "$", "steps", "=", "$", "this", "->", "getPath", "(", "$"...
Extracts a value from the response for a given path. @param string $path Name of the path to get the value for @return string|null
[ "Extracts", "a", "value", "from", "the", "response", "for", "a", "given", "path", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/PathUserResponse.php#L129-L155
hwi/HWIOAuthBundle
OAuth/Response/PathUserResponse.php
PathUserResponse.getValue
private function getValue($steps, array $data) { $value = $data; foreach (explode('.', $steps) as $step) { if (!\array_key_exists($step, $value)) { return null; } $value = $value[$step]; } return $value; }
php
private function getValue($steps, array $data) { $value = $data; foreach (explode('.', $steps) as $step) { if (!\array_key_exists($step, $value)) { return null; } $value = $value[$step]; } return $value; }
[ "private", "function", "getValue", "(", "$", "steps", ",", "array", "$", "data", ")", "{", "$", "value", "=", "$", "data", ";", "foreach", "(", "explode", "(", "'.'", ",", "$", "steps", ")", "as", "$", "step", ")", "{", "if", "(", "!", "\\", "a...
@param string $steps @param array $data @return string|null
[ "@param", "string", "$steps", "@param", "array", "$data" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/PathUserResponse.php#L163-L175
hwi/HWIOAuthBundle
OAuth/ResourceOwner/YoutubeResourceOwner.php
YoutubeResourceOwner.getAuthorizationUrl
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { return parent::getAuthorizationUrl($redirectUri, array_merge([ 'access_type' => $this->options['access_type'], 'approval_prompt' => $this->options['approval_prompt'], 'request_visible_actions...
php
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { return parent::getAuthorizationUrl($redirectUri, array_merge([ 'access_type' => $this->options['access_type'], 'approval_prompt' => $this->options['approval_prompt'], 'request_visible_actions...
[ "public", "function", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "return", "parent", "::", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array_merge", "(", "[", "'access_type'", "=>", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/YoutubeResourceOwner.php#L37-L46
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.connectAction
public function connectAction(Request $request) { $connect = $this->container->getParameter('hwi_oauth.connect'); $hasUser = $this->getUser() ? $this->isGranted($this->container->getParameter('hwi_oauth.grant_rule')) : false; $error = $this->getErrorForRequest($request); // if conn...
php
public function connectAction(Request $request) { $connect = $this->container->getParameter('hwi_oauth.connect'); $hasUser = $this->getUser() ? $this->isGranted($this->container->getParameter('hwi_oauth.grant_rule')) : false; $error = $this->getErrorForRequest($request); // if conn...
[ "public", "function", "connectAction", "(", "Request", "$", "request", ")", "{", "$", "connect", "=", "$", "this", "->", "container", "->", "getParameter", "(", "'hwi_oauth.connect'", ")", ";", "$", "hasUser", "=", "$", "this", "->", "getUser", "(", ")", ...
Action that handles the login 'form'. If connecting is enabled the user will be redirected to the appropriate login urls or registration forms. @param Request $request @throws \LogicException @return Response
[ "Action", "that", "handles", "the", "login", "form", ".", "If", "connecting", "is", "enabled", "the", "user", "will", "be", "redirected", "to", "the", "appropriate", "login", "urls", "or", "registration", "forms", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L53-L84
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.registrationAction
public function registrationAction(Request $request, $key) { $connect = $this->container->getParameter('hwi_oauth.connect'); if (!$connect) { throw new NotFoundHttpException(); } $hasUser = $this->isGranted($this->container->getParameter('hwi_oauth.grant_rule')); ...
php
public function registrationAction(Request $request, $key) { $connect = $this->container->getParameter('hwi_oauth.connect'); if (!$connect) { throw new NotFoundHttpException(); } $hasUser = $this->isGranted($this->container->getParameter('hwi_oauth.grant_rule')); ...
[ "public", "function", "registrationAction", "(", "Request", "$", "request", ",", "$", "key", ")", "{", "$", "connect", "=", "$", "this", "->", "container", "->", "getParameter", "(", "'hwi_oauth.connect'", ")", ";", "if", "(", "!", "$", "connect", ")", "...
Shows a registration form if there is no user logged in and connecting is enabled. @param Request $request a request @param string $key key used for retrieving the right information for the registration form @return Response @throws NotFoundHttpException if `connect` functionality was not enabled @throws Access...
[ "Shows", "a", "registration", "form", "if", "there", "is", "no", "user", "logged", "in", "and", "connecting", "is", "enabled", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L99-L176
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.connectServiceAction
public function connectServiceAction(Request $request, $service) { $connect = $this->container->getParameter('hwi_oauth.connect'); if (!$connect) { throw new NotFoundHttpException(); } $hasUser = $this->isGranted($this->container->getParameter('hwi_oauth.grant_rule')); ...
php
public function connectServiceAction(Request $request, $service) { $connect = $this->container->getParameter('hwi_oauth.connect'); if (!$connect) { throw new NotFoundHttpException(); } $hasUser = $this->isGranted($this->container->getParameter('hwi_oauth.grant_rule')); ...
[ "public", "function", "connectServiceAction", "(", "Request", "$", "request", ",", "$", "service", ")", "{", "$", "connect", "=", "$", "this", "->", "container", "->", "getParameter", "(", "'hwi_oauth.connect'", ")", ";", "if", "(", "!", "$", "connect", ")...
Connects a user to a given account if the user is logged in and connect is enabled. @param Request $request the active request @param string $service name of the resource owner to connect to @throws \Exception @return Response @throws NotFoundHttpException if `connect` functionality was not enabled @throws AccessD...
[ "Connects", "a", "user", "to", "a", "given", "account", "if", "the", "user", "is", "logged", "in", "and", "connect", "is", "enabled", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L191-L262
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.redirectToServiceAction
public function redirectToServiceAction(Request $request, $service) { try { $authorizationUrl = $this->container->get('hwi_oauth.security.oauth_utils')->getAuthorizationUrl($request, $service); } catch (\RuntimeException $e) { throw new NotFoundHttpException($e->getMessage(),...
php
public function redirectToServiceAction(Request $request, $service) { try { $authorizationUrl = $this->container->get('hwi_oauth.security.oauth_utils')->getAuthorizationUrl($request, $service); } catch (\RuntimeException $e) { throw new NotFoundHttpException($e->getMessage(),...
[ "public", "function", "redirectToServiceAction", "(", "Request", "$", "request", ",", "$", "service", ")", "{", "try", "{", "$", "authorizationUrl", "=", "$", "this", "->", "container", "->", "get", "(", "'hwi_oauth.security.oauth_utils'", ")", "->", "getAuthori...
@param Request $request @param string $service @throws NotFoundHttpException @return RedirectResponse
[ "@param", "Request", "$request", "@param", "string", "$service" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L272-L309
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.getErrorForRequest
protected function getErrorForRequest(Request $request) { $authenticationErrorKey = Security::AUTHENTICATION_ERROR; if ($request->attributes->has($authenticationErrorKey)) { return $request->attributes->get($authenticationErrorKey); } $session = $request->getSession(); ...
php
protected function getErrorForRequest(Request $request) { $authenticationErrorKey = Security::AUTHENTICATION_ERROR; if ($request->attributes->has($authenticationErrorKey)) { return $request->attributes->get($authenticationErrorKey); } $session = $request->getSession(); ...
[ "protected", "function", "getErrorForRequest", "(", "Request", "$", "request", ")", "{", "$", "authenticationErrorKey", "=", "Security", "::", "AUTHENTICATION_ERROR", ";", "if", "(", "$", "request", "->", "attributes", "->", "has", "(", "$", "authenticationErrorKe...
Get the security error for a given request. @param Request $request @return string|\Exception
[ "Get", "the", "security", "error", "for", "a", "given", "request", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L318-L335
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.getResourceOwnerByName
protected function getResourceOwnerByName($name) { foreach ($this->container->getParameter('hwi_oauth.firewall_names') as $firewall) { $id = 'hwi_oauth.resource_ownermap.'.$firewall; if (!$this->container->has($id)) { continue; } $ownerMap = $...
php
protected function getResourceOwnerByName($name) { foreach ($this->container->getParameter('hwi_oauth.firewall_names') as $firewall) { $id = 'hwi_oauth.resource_ownermap.'.$firewall; if (!$this->container->has($id)) { continue; } $ownerMap = $...
[ "protected", "function", "getResourceOwnerByName", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "container", "->", "getParameter", "(", "'hwi_oauth.firewall_names'", ")", "as", "$", "firewall", ")", "{", "$", "id", "=", "'hwi_oauth.resource_own...
Get a resource owner by name. @param string $name @return ResourceOwnerInterface @throws NotFoundHttpException if there is no resource owner with the given name
[ "Get", "a", "resource", "owner", "by", "name", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L346-L361
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.authenticateUser
protected function authenticateUser(Request $request, UserInterface $user, $resourceOwnerName, $accessToken, $fakeLogin = true) { try { $this->container->get('hwi_oauth.user_checker')->checkPreAuth($user); $this->container->get('hwi_oauth.user_checker')->checkPostAuth($user); ...
php
protected function authenticateUser(Request $request, UserInterface $user, $resourceOwnerName, $accessToken, $fakeLogin = true) { try { $this->container->get('hwi_oauth.user_checker')->checkPreAuth($user); $this->container->get('hwi_oauth.user_checker')->checkPostAuth($user); ...
[ "protected", "function", "authenticateUser", "(", "Request", "$", "request", ",", "UserInterface", "$", "user", ",", "$", "resourceOwnerName", ",", "$", "accessToken", ",", "$", "fakeLogin", "=", "true", ")", "{", "try", "{", "$", "this", "->", "container", ...
Authenticate a user with Symfony Security. @param Request $request @param UserInterface $user @param string $resourceOwnerName @param string $accessToken @param bool $fakeLogin
[ "Authenticate", "a", "user", "with", "Symfony", "Security", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L372-L396
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.getTargetPath
private function getTargetPath(SessionInterface $session) { foreach ($this->container->getParameter('hwi_oauth.firewall_names') as $providerKey) { $sessionKey = '_security.'.$providerKey.'.target_path'; if ($session->has($sessionKey)) { return $session->get($sessionKe...
php
private function getTargetPath(SessionInterface $session) { foreach ($this->container->getParameter('hwi_oauth.firewall_names') as $providerKey) { $sessionKey = '_security.'.$providerKey.'.target_path'; if ($session->has($sessionKey)) { return $session->get($sessionKe...
[ "private", "function", "getTargetPath", "(", "SessionInterface", "$", "session", ")", "{", "foreach", "(", "$", "this", "->", "container", "->", "getParameter", "(", "'hwi_oauth.firewall_names'", ")", "as", "$", "providerKey", ")", "{", "$", "sessionKey", "=", ...
@param SessionInterface $session @return string|null
[ "@param", "SessionInterface", "$session" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L403-L413
hwi/HWIOAuthBundle
Controller/ConnectController.php
ConnectController.getConfirmationResponse
private function getConfirmationResponse(Request $request, array $accessToken, $service) { /** @var $currentToken OAuthToken */ $currentToken = $this->container->get('security.token_storage')->getToken(); /** @var $currentUser UserInterface */ $currentUser = $currentToken->getUser();...
php
private function getConfirmationResponse(Request $request, array $accessToken, $service) { /** @var $currentToken OAuthToken */ $currentToken = $this->container->get('security.token_storage')->getToken(); /** @var $currentUser UserInterface */ $currentUser = $currentToken->getUser();...
[ "private", "function", "getConfirmationResponse", "(", "Request", "$", "request", ",", "array", "$", "accessToken", ",", "$", "service", ")", "{", "/** @var $currentToken OAuthToken */", "$", "currentToken", "=", "$", "this", "->", "container", "->", "get", "(", ...
@param Request $request The active request @param array $accessToken The access token @param string $service Name of the resource owner to connect to @return Response @throws NotFoundHttpException if there is no resource owner with the given name
[ "@param", "Request", "$request", "The", "active", "request", "@param", "array", "$accessToken", "The", "access", "token", "@param", "string", "$service", "Name", "of", "the", "resource", "owner", "to", "connect", "to" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Controller/ConnectController.php#L424-L466
hwi/HWIOAuthBundle
Security/OAuthUtils.php
OAuthUtils.getAuthorizationUrl
public function getAuthorizationUrl(Request $request, $name, $redirectUrl = null, array $extraParameters = []) { $resourceOwner = $this->getResourceOwner($name); if (null === $redirectUrl) { if (!$this->connect || !$this->authorizationChecker->isGranted($this->grantRule)) { ...
php
public function getAuthorizationUrl(Request $request, $name, $redirectUrl = null, array $extraParameters = []) { $resourceOwner = $this->getResourceOwner($name); if (null === $redirectUrl) { if (!$this->connect || !$this->authorizationChecker->isGranted($this->grantRule)) { ...
[ "public", "function", "getAuthorizationUrl", "(", "Request", "$", "request", ",", "$", "name", ",", "$", "redirectUrl", "=", "null", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "resourceOwner", "=", "$", "this", "->", "getResourceOw...
@param Request $request @param string $name @param string $redirectUrl Optional @param array $extraParameters Optional @return string
[ "@param", "Request", "$request", "@param", "string", "$name", "@param", "string", "$redirectUrl", "Optional", "@param", "array", "$extraParameters", "Optional" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/OAuthUtils.php#L104-L116
hwi/HWIOAuthBundle
Security/OAuthUtils.php
OAuthUtils.getServiceAuthUrl
public function getServiceAuthUrl(Request $request, ResourceOwnerInterface $resourceOwner) { if ($resourceOwner->getOption('auth_with_one_url')) { return $this->httpUtils->generateUri($request, $this->getResourceOwnerCheckPath($resourceOwner->getName())); } $request->attributes-...
php
public function getServiceAuthUrl(Request $request, ResourceOwnerInterface $resourceOwner) { if ($resourceOwner->getOption('auth_with_one_url')) { return $this->httpUtils->generateUri($request, $this->getResourceOwnerCheckPath($resourceOwner->getName())); } $request->attributes-...
[ "public", "function", "getServiceAuthUrl", "(", "Request", "$", "request", ",", "ResourceOwnerInterface", "$", "resourceOwner", ")", "{", "if", "(", "$", "resourceOwner", "->", "getOption", "(", "'auth_with_one_url'", ")", ")", "{", "return", "$", "this", "->", ...
@param Request $request @param ResourceOwnerInterface $resourceOwner @return string
[ "@param", "Request", "$request", "@param", "ResourceOwnerInterface", "$resourceOwner" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/OAuthUtils.php#L124-L133
hwi/HWIOAuthBundle
Security/OAuthUtils.php
OAuthUtils.getLoginUrl
public function getLoginUrl(Request $request, $name) { // Just to check that this resource owner exists $this->getResourceOwner($name); $request->attributes->set('service', $name); return $this->httpUtils->generateUri($request, 'hwi_oauth_service_redirect'); }
php
public function getLoginUrl(Request $request, $name) { // Just to check that this resource owner exists $this->getResourceOwner($name); $request->attributes->set('service', $name); return $this->httpUtils->generateUri($request, 'hwi_oauth_service_redirect'); }
[ "public", "function", "getLoginUrl", "(", "Request", "$", "request", ",", "$", "name", ")", "{", "// Just to check that this resource owner exists", "$", "this", "->", "getResourceOwner", "(", "$", "name", ")", ";", "$", "request", "->", "attributes", "->", "set...
@param Request $request @param string $name @return string
[ "@param", "Request", "$request", "@param", "string", "$name" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/OAuthUtils.php#L141-L149
hwi/HWIOAuthBundle
Security/OAuthUtils.php
OAuthUtils.signRequest
public static function signRequest($method, $url, $parameters, $clientSecret, $tokenSecret = '', $signatureMethod = self::SIGNATURE_METHOD_HMAC) { // Validate required parameters foreach (['oauth_consumer_key', 'oauth_timestamp', 'oauth_nonce', 'oauth_version', 'oauth_signature_method'] as $paramete...
php
public static function signRequest($method, $url, $parameters, $clientSecret, $tokenSecret = '', $signatureMethod = self::SIGNATURE_METHOD_HMAC) { // Validate required parameters foreach (['oauth_consumer_key', 'oauth_timestamp', 'oauth_nonce', 'oauth_version', 'oauth_signature_method'] as $paramete...
[ "public", "static", "function", "signRequest", "(", "$", "method", ",", "$", "url", ",", "$", "parameters", ",", "$", "clientSecret", ",", "$", "tokenSecret", "=", "''", ",", "$", "signatureMethod", "=", "self", "::", "SIGNATURE_METHOD_HMAC", ")", "{", "//...
Sign the request parameters. @param string $method Request method @param string $url Request url @param array $parameters Parameters for the request @param string $clientSecret Client secret to use as key part of signing @param string $tokenSecret Optional token secret to use with sig...
[ "Sign", "the", "request", "parameters", "." ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/OAuthUtils.php#L165-L249
hwi/HWIOAuthBundle
Security/OAuthUtils.php
OAuthUtils.getResourceOwner
protected function getResourceOwner($name) { foreach ($this->ownerMaps as $ownerMap) { $resourceOwner = $ownerMap->getResourceOwnerByName($name); if ($resourceOwner instanceof ResourceOwnerInterface) { return $resourceOwner; } } throw new ...
php
protected function getResourceOwner($name) { foreach ($this->ownerMaps as $ownerMap) { $resourceOwner = $ownerMap->getResourceOwnerByName($name); if ($resourceOwner instanceof ResourceOwnerInterface) { return $resourceOwner; } } throw new ...
[ "protected", "function", "getResourceOwner", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "ownerMaps", "as", "$", "ownerMap", ")", "{", "$", "resourceOwner", "=", "$", "ownerMap", "->", "getResourceOwnerByName", "(", "$", "name", ")", ";"...
@param string $name @return ResourceOwnerInterface @throws \RuntimeException
[ "@param", "string", "$name" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/OAuthUtils.php#L258-L268
hwi/HWIOAuthBundle
Security/OAuthUtils.php
OAuthUtils.getResourceOwnerCheckPath
protected function getResourceOwnerCheckPath($name) { foreach ($this->ownerMaps as $ownerMap) { if ($potentialResourceOwnerCheckPath = $ownerMap->getResourceOwnerCheckPath($name)) { return $potentialResourceOwnerCheckPath; } } return null; }
php
protected function getResourceOwnerCheckPath($name) { foreach ($this->ownerMaps as $ownerMap) { if ($potentialResourceOwnerCheckPath = $ownerMap->getResourceOwnerCheckPath($name)) { return $potentialResourceOwnerCheckPath; } } return null; }
[ "protected", "function", "getResourceOwnerCheckPath", "(", "$", "name", ")", "{", "foreach", "(", "$", "this", "->", "ownerMaps", "as", "$", "ownerMap", ")", "{", "if", "(", "$", "potentialResourceOwnerCheckPath", "=", "$", "ownerMap", "->", "getResourceOwnerChe...
@param string $name @return string|null
[ "@param", "string", "$name" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/OAuthUtils.php#L275-L284
hwi/HWIOAuthBundle
Security/Http/EntryPoint/OAuthEntryPoint.php
OAuthEntryPoint.start
public function start(Request $request, AuthenticationException $authException = null) { if ($this->useForward) { $subRequest = $this->httpUtils->createRequest($request, $this->loginPath); $subRequest->query->add($request->query->getIterator()->getArrayCopy()); $response...
php
public function start(Request $request, AuthenticationException $authException = null) { if ($this->useForward) { $subRequest = $this->httpUtils->createRequest($request, $this->loginPath); $subRequest->query->add($request->query->getIterator()->getArrayCopy()); $response...
[ "public", "function", "start", "(", "Request", "$", "request", ",", "AuthenticationException", "$", "authException", "=", "null", ")", "{", "if", "(", "$", "this", "->", "useForward", ")", "{", "$", "subRequest", "=", "$", "this", "->", "httpUtils", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Http/EntryPoint/OAuthEntryPoint.php#L67-L82
hwi/HWIOAuthBundle
Security/Http/Firewall/OAuthListener.php
OAuthListener.requiresAuthentication
public function requiresAuthentication(Request $request) { // Check if the route matches one of the check paths foreach ($this->checkPaths as $checkPath) { if ($this->httpUtils->checkRequestPath($request, $checkPath)) { return true; } } return...
php
public function requiresAuthentication(Request $request) { // Check if the route matches one of the check paths foreach ($this->checkPaths as $checkPath) { if ($this->httpUtils->checkRequestPath($request, $checkPath)) { return true; } } return...
[ "public", "function", "requiresAuthentication", "(", "Request", "$", "request", ")", "{", "// Check if the route matches one of the check paths", "foreach", "(", "$", "this", "->", "checkPaths", "as", "$", "checkPath", ")", "{", "if", "(", "$", "this", "->", "http...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Http/Firewall/OAuthListener.php#L59-L69
hwi/HWIOAuthBundle
Security/Http/Firewall/OAuthListener.php
OAuthListener.attemptAuthentication
protected function attemptAuthentication(Request $request) { /* @var ResourceOwnerInterface $resourceOwner */ list($resourceOwner, $checkPath) = $this->resourceOwnerMap->getResourceOwnerByRequest($request); if (!$resourceOwner) { throw new AuthenticationException('No resource ow...
php
protected function attemptAuthentication(Request $request) { /* @var ResourceOwnerInterface $resourceOwner */ list($resourceOwner, $checkPath) = $this->resourceOwnerMap->getResourceOwnerByRequest($request); if (!$resourceOwner) { throw new AuthenticationException('No resource ow...
[ "protected", "function", "attemptAuthentication", "(", "Request", "$", "request", ")", "{", "/* @var ResourceOwnerInterface $resourceOwner */", "list", "(", "$", "resourceOwner", ",", "$", "checkPath", ")", "=", "$", "this", "->", "resourceOwnerMap", "->", "getResourc...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Http/Firewall/OAuthListener.php#L74-L105
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FlickrResourceOwner.php
FlickrResourceOwner.getAuthorizationUrl
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { $token = $this->getRequestToken($redirectUri, $extraParameters); return $this->normalizeUrl($this->options['authorization_url'], [ 'oauth_token' => $token['oauth_token'], 'perms' => $this->optio...
php
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { $token = $this->getRequestToken($redirectUri, $extraParameters); return $this->normalizeUrl($this->options['authorization_url'], [ 'oauth_token' => $token['oauth_token'], 'perms' => $this->optio...
[ "public", "function", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "token", "=", "$", "this", "->", "getRequestToken", "(", "$", "redirectUri", ",", "$", "extraParameters", ")", ";", "r...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FlickrResourceOwner.php#L36-L45
hwi/HWIOAuthBundle
OAuth/ResourceOwner/FlickrResourceOwner.php
FlickrResourceOwner.getUserInformation
public function getUserInformation(array $accessToken, array $extraParameters = []) { $response = $this->getUserResponse(); $response->setData($accessToken); $response->setResourceOwner($this); $response->setOAuthToken(new OAuthToken($accessToken)); return $response; }
php
public function getUserInformation(array $accessToken, array $extraParameters = []) { $response = $this->getUserResponse(); $response->setData($accessToken); $response->setResourceOwner($this); $response->setOAuthToken(new OAuthToken($accessToken)); return $response; }
[ "public", "function", "getUserInformation", "(", "array", "$", "accessToken", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "$", "response", "=", "$", "this", "->", "getUserResponse", "(", ")", ";", "$", "response", "->", "setData", "(", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/FlickrResourceOwner.php#L50-L58
hwi/HWIOAuthBundle
OAuth/Response/SensioConnectUserResponse.php
SensioConnectUserResponse.getNickname
public function getNickname() { $username = null; $accounts = $this->xpath->query('./foaf:account/foaf:OnlineAccount', $this->data); for ($i = 0; $i < $accounts->length; ++$i) { $account = $accounts->item($i); if ('SensioLabs Connect' === $this->getNodeValue('./foaf:n...
php
public function getNickname() { $username = null; $accounts = $this->xpath->query('./foaf:account/foaf:OnlineAccount', $this->data); for ($i = 0; $i < $accounts->length; ++$i) { $account = $accounts->item($i); if ('SensioLabs Connect' === $this->getNodeValue('./foaf:n...
[ "public", "function", "getNickname", "(", ")", "{", "$", "username", "=", "null", ";", "$", "accounts", "=", "$", "this", "->", "xpath", "->", "query", "(", "'./foaf:account/foaf:OnlineAccount'", ",", "$", "this", "->", "data", ")", ";", "for", "(", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/SensioConnectUserResponse.php#L43-L57
hwi/HWIOAuthBundle
OAuth/Response/SensioConnectUserResponse.php
SensioConnectUserResponse.setData
public function setData($data) { $dom = new \DOMDocument(); try { if (!$dom->loadXML($data)) { throw new \ErrorException('Could not transform this xml to a \DOMDocument instance.'); } } catch (\Exception $e) { throw new AuthenticationExcept...
php
public function setData($data) { $dom = new \DOMDocument(); try { if (!$dom->loadXML($data)) { throw new \ErrorException('Could not transform this xml to a \DOMDocument instance.'); } } catch (\Exception $e) { throw new AuthenticationExcept...
[ "public", "function", "setData", "(", "$", "data", ")", "{", "$", "dom", "=", "new", "\\", "DOMDocument", "(", ")", ";", "try", "{", "if", "(", "!", "$", "dom", "->", "loadXML", "(", "$", "data", ")", ")", "{", "throw", "new", "\\", "ErrorExcepti...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/SensioConnectUserResponse.php#L102-L122
hwi/HWIOAuthBundle
OAuth/Response/SensioConnectUserResponse.php
SensioConnectUserResponse.getNodeValue
protected function getNodeValue($query, \DOMElement $element, $nodeType = 'normal') { $nodeList = $this->xpath->query($query, $element); if ($nodeList && $nodeList->length > 0) { $node = $nodeList->item(0); switch ($nodeType) { case 'link': ...
php
protected function getNodeValue($query, \DOMElement $element, $nodeType = 'normal') { $nodeList = $this->xpath->query($query, $element); if ($nodeList && $nodeList->length > 0) { $node = $nodeList->item(0); switch ($nodeType) { case 'link': ...
[ "protected", "function", "getNodeValue", "(", "$", "query", ",", "\\", "DOMElement", "$", "element", ",", "$", "nodeType", "=", "'normal'", ")", "{", "$", "nodeList", "=", "$", "this", "->", "xpath", "->", "query", "(", "$", "query", ",", "$", "element...
@param string $query @param \DOMElement $element @param string $nodeType @return mixed|null
[ "@param", "string", "$query", "@param", "\\", "DOMElement", "$element", "@param", "string", "$nodeType" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/Response/SensioConnectUserResponse.php#L131-L151
hwi/HWIOAuthBundle
OAuth/ResourceOwner/DailymotionResourceOwner.php
DailymotionResourceOwner.getAuthorizationUrl
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { return parent::getAuthorizationUrl($redirectUri, array_merge(['display' => $this->options['display']], $extraParameters)); }
php
public function getAuthorizationUrl($redirectUri, array $extraParameters = []) { return parent::getAuthorizationUrl($redirectUri, array_merge(['display' => $this->options['display']], $extraParameters)); }
[ "public", "function", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array", "$", "extraParameters", "=", "[", "]", ")", "{", "return", "parent", "::", "getAuthorizationUrl", "(", "$", "redirectUri", ",", "array_merge", "(", "[", "'display'", "=>", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/DailymotionResourceOwner.php#L37-L40
hwi/HWIOAuthBundle
OAuth/ResourceOwner/RunKeeperResourceOwner.php
RunKeeperResourceOwner.getUserResource
public function getUserResource($accessToken) { $response = $this->httpRequest( $this->normalizeUrl($this->options['user_resource_url']), null, ['Authorization' => 'Bearer '.$accessToken] ); return $this->getResponseContent($response); }
php
public function getUserResource($accessToken) { $response = $this->httpRequest( $this->normalizeUrl($this->options['user_resource_url']), null, ['Authorization' => 'Bearer '.$accessToken] ); return $this->getResponseContent($response); }
[ "public", "function", "getUserResource", "(", "$", "accessToken", ")", "{", "$", "response", "=", "$", "this", "->", "httpRequest", "(", "$", "this", "->", "normalizeUrl", "(", "$", "this", "->", "options", "[", "'user_resource_url'", "]", ")", ",", "null"...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/OAuth/ResourceOwner/RunKeeperResourceOwner.php#L34-L43
hwi/HWIOAuthBundle
Security/Core/User/EntityUserProvider.php
EntityUserProvider.loadUserByUsername
public function loadUserByUsername($username) { $user = $this->findUser(['username' => $username]); if (!$user) { throw new UsernameNotFoundException(sprintf("User '%s' not found.", $username)); } return $user; }
php
public function loadUserByUsername($username) { $user = $this->findUser(['username' => $username]); if (!$user) { throw new UsernameNotFoundException(sprintf("User '%s' not found.", $username)); } return $user; }
[ "public", "function", "loadUserByUsername", "(", "$", "username", ")", "{", "$", "user", "=", "$", "this", "->", "findUser", "(", "[", "'username'", "=>", "$", "username", "]", ")", ";", "if", "(", "!", "$", "user", ")", "{", "throw", "new", "Usernam...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/EntityUserProvider.php#L72-L80
hwi/HWIOAuthBundle
Security/Core/User/EntityUserProvider.php
EntityUserProvider.loadUserByOAuthUserResponse
public function loadUserByOAuthUserResponse(UserResponseInterface $response) { $resourceOwnerName = $response->getResourceOwner()->getName(); if (!isset($this->properties[$resourceOwnerName])) { throw new \RuntimeException(sprintf("No property defined for entity for resource owner '%s'....
php
public function loadUserByOAuthUserResponse(UserResponseInterface $response) { $resourceOwnerName = $response->getResourceOwner()->getName(); if (!isset($this->properties[$resourceOwnerName])) { throw new \RuntimeException(sprintf("No property defined for entity for resource owner '%s'....
[ "public", "function", "loadUserByOAuthUserResponse", "(", "UserResponseInterface", "$", "response", ")", "{", "$", "resourceOwnerName", "=", "$", "response", "->", "getResourceOwner", "(", ")", "->", "getName", "(", ")", ";", "if", "(", "!", "isset", "(", "$",...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/EntityUserProvider.php#L85-L99
hwi/HWIOAuthBundle
Security/Core/User/EntityUserProvider.php
EntityUserProvider.refreshUser
public function refreshUser(UserInterface $user) { $accessor = PropertyAccess::createPropertyAccessor(); $identifier = $this->properties['identifier']; if (!$accessor->isReadable($user, $identifier) || !$this->supportsClass(\get_class($user))) { throw new UnsupportedUserException...
php
public function refreshUser(UserInterface $user) { $accessor = PropertyAccess::createPropertyAccessor(); $identifier = $this->properties['identifier']; if (!$accessor->isReadable($user, $identifier) || !$this->supportsClass(\get_class($user))) { throw new UnsupportedUserException...
[ "public", "function", "refreshUser", "(", "UserInterface", "$", "user", ")", "{", "$", "accessor", "=", "PropertyAccess", "::", "createPropertyAccessor", "(", ")", ";", "$", "identifier", "=", "$", "this", "->", "properties", "[", "'identifier'", "]", ";", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/EntityUserProvider.php#L104-L118
hwi/HWIOAuthBundle
Security/Core/User/EntityUserProvider.php
EntityUserProvider.findUser
protected function findUser(array $criteria) { if (null === $this->repository) { $this->repository = $this->em->getRepository($this->class); } return $this->repository->findOneBy($criteria); }
php
protected function findUser(array $criteria) { if (null === $this->repository) { $this->repository = $this->em->getRepository($this->class); } return $this->repository->findOneBy($criteria); }
[ "protected", "function", "findUser", "(", "array", "$", "criteria", ")", "{", "if", "(", "null", "===", "$", "this", "->", "repository", ")", "{", "$", "this", "->", "repository", "=", "$", "this", "->", "em", "->", "getRepository", "(", "$", "this", ...
@param array $criteria @return object
[ "@param", "array", "$criteria" ]
train
https://github.com/hwi/HWIOAuthBundle/blob/1c574fd433125c0c5e4811e9cb8bb6d0bcfe144e/Security/Core/User/EntityUserProvider.php#L133-L140
spatie/laravel-uptime-monitor
src/Notifications/Notifications/CertificateExpiresSoon.php
CertificateExpiresSoon.toMail
public function toMail($notifiable) { $mailMessage = (new MailMessage) ->error() ->subject($this->getMessageText()) ->line($this->getMessageText()); foreach ($this->getMonitorProperties() as $name => $value) { $mailMessage->line($name.': '.$value); ...
php
public function toMail($notifiable) { $mailMessage = (new MailMessage) ->error() ->subject($this->getMessageText()) ->line($this->getMessageText()); foreach ($this->getMonitorProperties() as $name => $value) { $mailMessage->line($name.': '.$value); ...
[ "public", "function", "toMail", "(", "$", "notifiable", ")", "{", "$", "mailMessage", "=", "(", "new", "MailMessage", ")", "->", "error", "(", ")", "->", "subject", "(", "$", "this", "->", "getMessageText", "(", ")", ")", "->", "line", "(", "$", "thi...
Get the mail representation of the notification. @param mixed $notifiable @return \Illuminate\Notifications\Messages\MailMessage
[ "Get", "the", "mail", "representation", "of", "the", "notification", "." ]
train
https://github.com/spatie/laravel-uptime-monitor/blob/d3452a18c67babfdac013e53f24df952291ed3cb/src/Notifications/Notifications/CertificateExpiresSoon.php#L23-L35