Download the PHP package symfonycorp/connect without Composer
On this page you can find all versions of the php package symfonycorp/connect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download symfonycorp/connect
More information about symfonycorp/connect
Files in symfonycorp/connect
Package connect
Short Description SymfonyConnect SDK
License MIT
Homepage https://github.com/symfonycorp/connect
Informations about the package connect
SymfonyConnect SDK
About
This is the official SDK for the SymfonyConnect API. It works for the public API or with a registered OAuth application. To register an application, please go to your SymfonyConnect Account.
Installation
To install the SDK, run the command below and you will get the latest version:
Usage
OAuth
To use the SDK in a Symfony application, we recommend using the built-in bundle.
Otherwise, you can take inspiration from the following part, which will show you how to include OAuth authentication within a Silex App.
Warning: We take for granted that you already have registered your app on
SymfonyConnect and that you're in
possession of your application_id
, application_secret
and scope
.
-
Configure your silex app with the data we gave us at app registration.
This done. We can now move on to the second step.
-
We need to create two controllers to handle the OAuth2 Three-Legged workflow.
The first controller goal is to redirect the user to SymfonyConnect in order to ask him for the authorization that your app will use his data. This controller will be bound to the
connect_auth
route. In your template, you'll need to create a link to this route.The second controller is the one that will welcome the user after SymfonyConnect redirected him to your application. When registering your client, you'll have to provide the exact absolute URL that points to this controller.
-
Create a link from your template
In a template, you can use the following snippet of code to render a SymfonyConnect button:
And include the following CSS file:
https://connect.symfony.com/css/sln.css
Et voilà! Your application can now use SymfonyConnect as an authentication method!
The API
The SymfonyConnect Connect API is RESTFul and (tries to) conforms to the HATEOAS principle.
Here are some useful recipes.
-
Search
- Edit authenticated user
As you can see by these examples, you always have to to go through the API Root to make an action. This is because the API is discoverable and that the SDK should not know anything beside the API's entry point.
License
This library is licensed under the MIT license.
All versions of connect with dependencies
ext-dom Version *
ext-json Version *
symfony/http-client Version ^5.4|^6.0|^7.0