Symfony
Setup guide for install and configure 1Pilot client on Symfony

Install on Symfony Application

Setup Symfony 5

Install Symfony Bundle version 2
1
composer require 1pilotapp/symfony-client:^2.0
Copied!
1. add a new config/packages/one_pilot_client.yaml file with the following content
1
one_pilot_client:
2
private_key: "%env(ONE_PILOT_PRIVATE_KEY)%"
3
mail_from_address: "%env(ONE_PILOT_MAIL_FROM_ADDRESS)%"
Copied!
2. add to your .env file the following parameters:
1
ONE_PILOT_PRIVATE_KEY=[your key]
2
ONE_PILOT_MAIL_FROM_ADDRESS=[[email protected]]
Copied!
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:
1
one_pilot:
2
resource: "@OnePilotClientBundle/Resources/config/routing.xml"
3
prefix: /
Copied!

Setup Symfony 4.4

Install Symfony Bundle version 2
1
composer require 1pilotapp/symfony-client:^2.0
Copied!
1. add a new config/packages/one_pilot_client.yaml file with the following content
1
one_pilot_client:
2
private_key: "%env(ONE_PILOT_PRIVATE_KEY)%"
3
mail_from_address: "%env(ONE_PILOT_MAIL_FROM_ADDRESS)%"
Copied!
2. add to your .env file the following parameters:
1
ONE_PILOT_PRIVATE_KEY=[your key]
2
ONE_PILOT_MAIL_FROM_ADDRESS=[[email protected]]
Copied!
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:
1
one_pilot:
2
resource: "@OnePilotClientBundle/Resources/config/routing.xml"
3
prefix: /
Copied!

Setup Symfony 4

Install Symfony Bundle version 1 (for symfony 4.0 - 4.3)
1
composer require 1pilotapp/symfony-client:^1.0
Copied!
1. add a new config/packages/one_pilot_client.yaml file with the following content
1
one_pilot_client:
2
private_key: "%env(ONE_PILOT_PRIVATE_KEY)%"
3
mail_from_address: "%env(ONE_PILOT_MAIL_FROM_ADDRESS)%"
Copied!
2. add to your .env file the following parameters:
1
ONE_PILOT_PRIVATE_KEY=[your key]
2
ONE_PILOT_MAIL_FROM_ADDRESS=[[email protected]]
Copied!
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:
1
one_pilot:
2
resource: "@OnePilotClientBundle/Resources/config/routing.xml"
3
prefix: /
Copied!

Setup Symfony 3

Install Symfony Bundle version 1
1
composer require 1pilotapp/symfony-client:^1.0
Copied!
1. add to your app/config/config.yml file the following configuration keys:
1
one_pilot_client:
2
private_key: "%one_pilot_private_key%"
3
mail_from_address: "%one_pilot_mail_from_address%"
Copied!
2. add to your app/config/parameters.yml.dist file the following parameters:
1
one_pilot_private_key: ~
2
one_pilot_mail_from_address: ~
Copied!
This defines the new required configuration parameters.
3. add to your app/config/parameters.yml file the following parameters:
1
one_pilot_private_key: [your key]
2
one_pilot_mail_from_address: [[email protected]]
Copied!
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 parameters.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:
1
one_pilot:
2
resource: "@OnePilotClientBundle/Resources/config/routing.xml"
3
prefix: /
Copied!
5. add to your app/AppKernel.php file, in the registerBundles method, the following line:
1
...
2
new OnePilot\ClientBundle\OnePilotClientBundle(),
3
...
Copied!

Connection troubleshooting

Symfony firewall

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:
1
1pilot:
2
pattern: ^/onepilot/
3
anonymous: true
Copied!
and the following line in the access_control section
1
- { path: '^/onepilot', roles: IS_AUTHENTICATED_ANONYMOUSLY }
Copied!

Server time issue

If your server is not at time you can have issue to connect your application to 1Pilot. For solve that edit app/config/config.ymland add skip_timestamp_validation like bellow.
1
one_pilot_client:
2
private_key: "..."
3
skip_timestamp_validation: true
Copied!
Please note that this option will decrease security and that you should as much as possible set your server at the correct time.
Last modified 10mo ago