hwi/oauth-bundle
Symfony bundle for OAuth1.0a/OAuth2 login and user authentication. Supports Symfony 6.4–8.0 (PHP 8.3+) and integrates dozens of providers (Google, GitHub, Facebook, Apple, LinkedIn, Azure, Keycloak, etc.).
firebase/php-jwt support to 7.0,show_dialog option to Spotify resource owner,6.3 and 7.0,Amazon Cognito resource owner,failure_path in AuthenticationFailureHandler when connect functionality is not enabled,failure_handler in security configuration if set,AuthenticatorInterface instead of OAuthAuthenticator in RefreshAccessTokenListener,OdnoklassnikiResourceOwner,use_authorization_to_get_token to be configured to false for generic OAuth2,null as $registrationForm in RegisterController,>6.0, <6.3,Templating\Helper\OAuthHelper was merged into Twig\Extension\OAuthRuntime,TYPE constant or is null, then key will be calculated by converting its class name without ResourceOwner suffix to snake_case, if neither is felt, then \LogicException will be thrown,UserResponseInterface::getUsername() was deprecated in favour of UserResponseInterface::getUserIdentifier() to match changes in Symfony Security component,[@internal](https://github.com/internal) resourceOwner oauth types in Configuration are calculated automatically by scandir. All classes extended from GenericOAuth[X]ResourceOwner get oauth[X] type. If class only implements ResourceOwnerInterface then its oauth type is unknown. ResourceOwner key (parameter type in configs) should have defined ResourceOwner::TYPE constant. Each user defined custom ResourceOwner class that implemented ResourceOwnerInterface will be registered automatically. If autoconfigure option is disabled user have to add the tag hwi_oauth.resource_owner to the service definition,ConnectController was split into two smaller ones, Connect\ConnectController & Connect\RegisterController,OAuth1ResourceOwner & OAuth2ResourceOwner to cover case of implementing custom oauth resource owners,CleverResourceOwner::doGetRequest,TransportExceptionInterface in AbstractResourceOwner::getResponseContent() method,OAuthUserProvider::loadUserByOAuthUserResponse() when nickname is not available in OAuth response,firebase/php-jwt library,firewall_names, firewalls are now computed automatically - all firewalls that have defined oauth authenticator/provider will be collected,GenericOAuth2ResourceOwner resource owners), if option refresh_on_expire set to true,refresh_on_expure set to true,[@internal](https://github.com/internal)) Removed/replaced redundant argument $firewallNames from controllers. If controller class was copied and replaced, adapt list of arguments: In controller use $resourceOwnerMapLocator->getFirewallNames(),RefreshTokenListener cannot be lazy. If current firewall is lazy (or anonymous: lazy) then current auth token is often initializing on kernel.response. In this case new access token will not be stored in session. Therefore, the expired token will be refreshed on each request,InteractiveLoginEvent will be triggered also for OAuthAuthenticator,*.xml to *.php (services and routes). Xml routing configs connect.xml, login.xml and redirect.xml are steel present but deprecated. Please use *.php variants in your includes instead.OAuthExtension is now a lazy Twig extension using a Runtime,FOSUserBundle,process() argument for Form/RegistrationFormHandlerInterface, from Form $form to FormInterface $form,Resources/views/Connect/connect_confirm.html.twig from fos_user_registration_register to registration_register,fosub from oauth_user_provider,hwi_oauth.fosub, & all related DI parameters,hwi_oauth.registration.form.factory in favour of declaring form class name as DI parameter: hwi_oauth.connect.registration_form,ResourceOwnerMapInterface::hasResourceOwnerByName signature, update if you use a custom resource owner,ResourceOwnerMapInterface::getResourceOwnerByName signature, update if you use a custom resource owner,ResourceOwnerMapInterface::getResourceOwnerByRequest signature, update if you use a custom resource owner,ResourceOwnerMapInterface::getResourceOwnerCheckPath signature, update if you use a custom resource owner,ResourceOwnerMap uses service locator instead of DI container,hwi_oauth.abstract_resource_owner.generic, hwi_oauth.abstract_resource_owner.oauth1 & hwi_oauth.abstract_resource_owner.oauth2,setName() method from OAuth/ResourceOwnerInterface,__construct() argument for OAuth/ResourceOwner/AbstractResourceOwner, from HttpMethodsClient $httpClient to HttpClientInterface $httpClient,php-http/httplug-bundle with symfony/http-clienthwi_oauth.http configuration,src/,tests/,Resources/doc into: docs/,methods requirements:
hwi_oauth_connect_service: GET & POST,hwi_oauth_connect_registration: GET & POST,hwi_oauth_connect: GET,hwi_oauth_service_redirect: GET,AbstractOAuthToken::getCredentials() method,VkontakteResourceOwner option: api_version to not point to deprecated one,RequestStack::getMasterRequest() is deprecated since Symfony 5.3, use RequestStack::getMainRequest() if exists,GenericOAuth1ResourceOwnerTestCase, GenericOAuth2ResourceOwnerTestCase & ResourceOwnerTestCase test case classes for easier unit testing custom resource owners[@final](https://github.com/final) declaration from OAuthFactory & FOSUBUserProvider,.gitattributes to reduce amount of code in archives,hwi_oauth.connect.confirmation parameter,__construct() argument for OAuth/RequestDataStorage/SessionStorage, from SessionInterface $session to RequestStack $requestStack,final,HWIOAuthEvents::CONNECT_COMPLETED is fired,OAuthProvide to properly refresh data inside tokens,AppleResourceOwner,GitHubResourceOwner,Wunderlist resource owner,<4.4,<2.0,id_token exception in Azure resource owner,first_name & last_name in AzureResourceOwner,authorization & access_token urls,FilterUserResponseEvent,target_path,LoginController,setContainer call to service configuration for LoginController,Auth0ResourceOwner::doGetTokenRequest,Auth0ResourceOwner,LoginController is now optional,symfony/config,LoginController::connectAction should not fail if no token is available,Configuration has been marked final,ConnectController has been marked final,HWIOAuthExtension has been marked final,OAuthExtension has been marked final,SetResourceOwnerServiceNameCompilerPass has been marked final,ConnectController extends AbstractController instead of Controller,hwi_oauth.http_client has been marked private,hwi_oauth.security.oauth_utils has been marked private,Content-Length header must be a string,infos_url should not be empty,first- & last- names,getUserInformation() in ConnectController,AccountNotLinkedException,IS_AUTHENTICATED_FULLY in DI configuration,OAuthProvider::refreshAccessToken() when there is no refresh tokenPHPUnit_Framework_TestCase with PHPUnit\Framework\TestCase in tests,getUserInformation() for Dropbox v2,httpRequest() method in various resource owners,public to make code compatible with Symfony 4hwi.http_client config options are remove. HTTP configuration must rely on the HTTPlug client,hwi_oauth.templating_engine was removed,php-http/httplug-bundle support, to auto-provide needed HTTPlug services and get full Symfony integration,hwi.http.client and hwi.http.message_factory config keys to provide your own HTTPlug services,HWIOAuthEvents,ResourceOwnerInterface::addPaths() method for easier managing paths in resource owners,php-cs-fixer updated to latest version & run on base codeOAuthHelper should fallback to new Request in case of receiving null,FOSUserBundle integration,WechatResourceOwner,WechatResourceOwner,TrelloResourceOwner,OAuthProvider,target_path after successful registration/connection,form_enctype & replace with usage of form_start/form_end,~3.0,include_email option into Twitter resource owner,UserResponseInterface#getFirstName() method, also a new default path firstname
was added, this path holds the first name of user,UserResponseInterface#getLastName() method, also a new default path lastname
was added, this path holds the last name of user,UserResponseInterface::getOAuthToken() & basic implementation in AbstractUserResponse,GenericOAuth1ResourceOwner::getRequestToken() is now public method (was protected),firewall_name (will be removed in next major version)
renamed to firewall_names to support multiple firewalls,failed_auth_path which contains route name, on which user
will be redirected after failure when connecting accounts (i.e. user denies connection),appsecret_proof functionality support to the Facebook resource owner,sandbox functionality support to the Salesforce resource owner,ResourceOwnerMap no longer depends on deprecated ContainerAware class,json_decode in Mail.ru resource owner,AuthenticationExceptionfailure_handler configuration,FOSUBUserProvider::refreshUserFacebookResourceOwnerSessionStorage::save() could throw php error,OAuthToken::isExpired() always returned false,FoursquareResourceOwner, TwitchResourceOwner, SensioConnectResourceOwner
not working with bearer header,FacebookResourceOwner,FOSUBUserProvider::refreshUser() always returning old user,InstagramResourceOwner regression while getting user details,LinkedinResourceOwner regression while getting user details,revoke functionality to be available wider,SinaWeiboResourceOwner,FOSUBUserProvider should also implement UserProviderInterface,YahooResourceOwner infos_url to use new format,GithubResourceOwner revoke method,prompt for GoogleResourceOwner,WordpressResourceOwner user details API call,oauth_callback_confirmed was set too false,FacebookResourceOwnerSessionUnavailableException when returns back from service,EntityUserProvider should implement UserProviderInterface,createdAt property was missing when serializing the OAuthToken,VkontakteResourceOwner,YahooResourceOwner,FOSUBUserProvider when username is missingResourceOwnerInterface::isCsrfTokenValid() methodOAuth1RequestTokenStorageInterface along with the implementationsAbstractResourceOwner::__construct() now requires RequestDataStorageInterface
instance as last argumentRequestDataStorageInterface along with implementationGenericOAuth2ResourceOwner::getAccessToken() now returns an array
instead of a string. This array contains the access token and its 'expires_in'
value, along with any other parameters returned from the authentication providerOAuthAwareExceptionInterface#setToken(), OAuthAwareExceptionInterface#getRefreshToken(),
OAuthAwareExceptionInterface#getRawToken(), OAuthAwareExceptionInterface#getExpiresIn()
methodsAbstractResourceOwner::doGetAccessTokenRequest to doGetTokenRequestAdvancedPathUserResponse & AdvancedUserResponseInterfaceUserResponseInterface#getEmail(), UserResponseInterface#getProfilePicture(),
UserResponseInterface#getRefreshToken(), UserResponseInterface#getExpiresIn(),
UserResponseInterface#setOAuthToken() methodsUserResponseInterface::setAccessToken() methodAbstractUserResponse::getOAuthToken() method because it was ambiguousPathUserResponse#setPaths() method no longer overwrite default pathsPathUserResponse#getPath() method no longer throws an exception if path
not existsPathUserResponse#getValueForPath() removed second argument from this method,
it will not throw exception anymore if response or value is missing, but now will return
null insteadResourceOwnerInterface#getOption($name) methodResourceOwnerInterface#getUserInformation() now must receive array ($accessToken)
as first parameter, also added second parameter ($extraParameters) to be consistent
along all implementationsOAuthToken::getRefreshToken(), OAuthToken::setRefreshToken(), OAuthToken::getExpiresIn(),
OAuthToken::setExpiresIn(), OAuthToken::getRawToken(), OAuthToken::setRawToken()AbstractResourceOwner#addOptions() & ResourceOwnerInterface#setOption($name, $value)
methods which allows easy overwriting resource specific optionsaccess_type, request_visible_actions, approval_prompt & hd
in Google resource ownerAccountConnectorInterface::connect() method now requires the first
parameter to be instance of Symfony\Component\Security\Core\User\UserInterfaceConnectController::authenticateUser() method now requires the first
parameter to be instance of Symfony\Component\HttpFoundation\RequestAbstractResourceOwner::addOptions() methodOAuthUtils::getAuthorizationUrl() & OAuthUtils::getLoginUrl() methods
now expect first parameter to be instance of Symfony\Component\HttpFoundation\Request0.2.8 blocking usage without FOSUserBundleOAuthUtils::getAuthorizationUrl() ignoring given redirect URLloadUserByUsername()
or refreshUser() methodsOAuthUtils::signRequest() compatible with OAuth1.0a specificationarg_separator.output data for URL generation to prevent issuesSymfony\Component\Security\Core\Exception\AccessDeniedException
& Symfony\Component\HttpKernel\Exception\NotFoundHttpException instead of \Exception
to make cases more clearoauth_problem as authorization error and inform user instead logging error
in backgroundYahooResourceOwnerAbstractUserResponse::getOAuthToken() method to allow fetching only OAuth token detailsSymfony\Component\Security\Core\User\UserInterface in EntityUserProvider::refreshUserSessionStorage compatible with Symfony 2.0target_path_parameter in order to control the redirect path after loginhwi_oauth_authorization_url() twig helper functionrealm in configurationfirewall_name is requiredAlreadyBoundException when using FOSUserBundle 1.x integrationprofilePicture in views before calling itInMemoryProvider now shows user nickname as name instead of unique identifierrealm option if is empty in request headersusername to identifier to make it more clear that this path should
hold the unique user identifier (previously username)UserResponseInterface#getUsername() now always returns a real
unique user identifier, and uses path identifierOAuth1RequestTokenStorageInterface#save() second param $token must
now be an arrayredirect.xml routing has to be imported. See the setup docsUserResponseInterface#getRealName() method, also a new default path realname
was added, this path holds the real name of userUserResponseInterface#getNickName() method, also a new default path nickname
was added, this path holds the nickname of userUserResponseInterface#getAccessToken() and UserResponseInterface#setAccessTokenOAuthToken#getCredentials() returns an empty string to be consistent with
the security component. The access token can still be retrieved from the
getAccessToken() methodfirewall_name option required settingHow can I help you explore Laravel packages today?