Important

We are updating the images for OroCommerce version 6.1 to align with the latest changes in the back-office design. During this transition, some images may still show older versions. Thank you for your patience as we work to update all visuals to reflect these changes.

CLI Commands (SalesFrontendBundle) 

oro:sales-frontend:access-token:create 

Creates an OAuth2 access token for the specified user (if not specified, the default one is “admin”) for the Sales Frontend application for development or testing purposes.

php bin/console oro:sales-frontend:access-token:create

Commands in Use (Examples) 

The following example runs the creation of an OAuth2 access token and returns the result in JSON format:

php bin/console oro:sales-frontend:access-token:create --format=json

The output would be as follows:

{
    "user_identifier": "admin",
    "organization_id": 1,
    "token_type": "Bearer",
    "expires_in": 86400,
    "access_token": "access token hash",
    "refresh_token": "refresh token hash"
}

The following example runs creating of an OAuth2 access token for user sale:

php bin/console oro:sales-frontend:access-token:create --current-user=sale

The output would be as follows:

OAuth2 Access Token
-------------------
* user_identifier: sale
* organization_id: 1
* token_type: Bearer
* expires_in: 86400
* access_token: access token hash
* refresh_token: refresh token hash

Please note that if a user has access to more than one organization, you need to specify the organization for which you want to generate an access token for the specified user:

php bin/console oro:sales-frontend:access-token:create --current-user=admin --current-organization=1