Install Symfony Bundle version 2
composer require 1pilotapp/symfony-client:^2.0
1. add a new config/packages/one_pilot_client.yaml
file with the following content
one_pilot_client:private_key: "%env(ONE_PILOT_PRIVATE_KEY)%"mail_from_address: "%env(ONE_PILOT_MAIL_FROM_ADDRESS)%"
2. add to your .env
file the following parameters:
ONE_PILOT_PRIVATE_KEY=[your key]ONE_PILOT_MAIL_FROM_ADDRESS=[your-app-mail-from@example.com]
ONE_PILOT_PRIVATE_KEY
can be any random alphanumeric string. If you are not sure what key to use, go to 1Pilot dashboard and open the page to add a new site: a random key will be generated for you, and you can copy / paste it in your file. Of course you are free to create a totally different key, just make sure you have the same key in your.env
and on the 1Pilot dashboard.
ONE_PILOT_MAIL_FROM_ADDRESS
email address that you use for send mail from your application. It's used by the email verification tool for ensure emails are properly send by your application.
3. add to your config/routes.yaml
the following configuration:
one_pilot:resource: "@OnePilotClientBundle/Resources/config/routing.xml"prefix: /
Install Symfony Bundle version 2
composer require 1pilotapp/symfony-client:^2.0
1. add a new config/packages/one_pilot_client.yaml
file with the following content
one_pilot_client:private_key: "%env(ONE_PILOT_PRIVATE_KEY)%"mail_from_address: "%env(ONE_PILOT_MAIL_FROM_ADDRESS)%"
2. add to your .env
file the following parameters:
ONE_PILOT_PRIVATE_KEY=[your key]ONE_PILOT_MAIL_FROM_ADDRESS=[your-app-mail-from@example.com]
ONE_PILOT_PRIVATE_KEY
can be any random alphanumeric string. If you are not sure what key to use, go to 1Pilot dashboard and open the page to add a new site: a random key will be generated for you, and you can copy / paste it in your file. Of course you are free to create a totally different key, just make sure you have the same key in your.env
and on the 1Pilot dashboard.
ONE_PILOT_MAIL_FROM_ADDRESS
email address that you use for send mail from your application. It's used by the email verification tool for ensure emails are properly send by your application.
3. add to your config/routes.yaml
the following configuration:
one_pilot:resource: "@OnePilotClientBundle/Resources/config/routing.xml"prefix: /
Install Symfony Bundle version 1 (for symfony 4.0 - 4.3)
composer require 1pilotapp/symfony-client:^1.0
1. add a new config/packages/one_pilot_client.yaml
file with the following content
one_pilot_client:private_key: "%env(ONE_PILOT_PRIVATE_KEY)%"mail_from_address: "%env(ONE_PILOT_MAIL_FROM_ADDRESS)%"
2. add to your .env
file the following parameters:
ONE_PILOT_PRIVATE_KEY=[your key]ONE_PILOT_MAIL_FROM_ADDRESS=[your-app-mail-from@example.com]
ONE_PILOT_PRIVATE_KEY
can be any random alphanumeric string. If you are not sure what key to use, go to 1Pilot dashboard and open the page to add a new site: a random key will be generated for you, and you can copy / paste it in your file. Of course you are free to create a totally different key, just make sure you have the same key in your.env
and on the 1Pilot dashboard.
ONE_PILOT_MAIL_FROM_ADDRESS
email address that you use for send mail from your application. It's used by the email verification tool for ensure emails are properly send by your application.
3. add to your config/routes.yaml
the following configuration:
one_pilot:resource: "@OnePilotClientBundle/Resources/config/routing.xml"prefix: /
Install Symfony Bundle version 1
composer require 1pilotapp/symfony-client:^1.0
1. add to your app/config/config.yml
file the following configuration keys:
one_pilot_client:private_key: "%one_pilot_private_key%"mail_from_address: "%one_pilot_mail_from_address%"
2. add to your app/config/parameters.yml.dist
file the following parameters:
one_pilot_private_key: ~one_pilot_mail_from_address: ~
This defines the new required configuration parameters.
3. add to your app/config/parameters.yml
file the following parameters:
one_pilot_private_key: [your key]one_pilot_mail_from_address: [your-app-mail-from@example.com]
one_pilot_private_key
can be any random alphanumeric string. If you are not sure what key to use, go to 1Pilot dashboard and open the page to add a new site: a random key will be generated for you, and you can copy / paste it in your file. Of course you are free to create a totally different key, just make sure you have the same key in yourparameters.yml
and on the 1Pilot dashboard.
one_pilot_mail_from_address
email address that you use for send mail from your application. It's used by the email verification tool for ensure emails are properly send by your application.
4. add to your app/config/routing.yml
the following configuration:
one_pilot:resource: "@OnePilotClientBundle/Resources/config/routing.xml"prefix: /
5. add to your app/AppKernel.php
file, in the registerBundles
method, the following line:
...new OnePilot\ClientBundle\OnePilotClientBundle(),...
A common issue with Symfony application is the Symfony firewall that doesn't allow 1Pilot servers to connect to your website and redirect requests they performs to /onepilot/*
to the login form.
For fix that you have to allow anonymous access to /onepilot/
routes in the Symfony firewall and access_control
list.
To proceed edit config/packages/security.yaml
and add following lines in the firewalls
section before the main
entry:
1pilot:pattern: ^/onepilot/anonymous: true
and the following line in the access_control
section
- { path: '^/onepilot', roles: IS_AUTHENTICATED_ANONYMOUSLY }
If your server is not at time you can have issue to connect your application to 1Pilot. For solve that edit app/config/config.yml
and add skip_timestamp_validation
like bellow.
one_pilot_client:private_key: "..."skip_timestamp_validation: true
Please note that this option will decrease security and that you should as much as possible set your server at the correct time.