Closed DesignInvento closed 3 years ago
issue found in server api manager line number 228 system will trough an error if form state is not validate, so it would block activation
// Request is not being sent from license form (except validation), $request => WP_Error.
if (
( 'validate' !== $state ) &&
// phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode
( 'TWS' !== $auth_type || base64_decode( $auth_val ) !== $this->hash )
) {
return $this->request_error( __( 'Request was made outside of license form.', 'tws-license-manager-server' ), 401 );
}
Hey @DesignInvento,
Thank you for trying out this plugin. Could you please show the full code used to start the client manager (codes you implemented as shown in CLIENT.md
file).
I think the issue is caused because of missing hash_with()
method.
Hi Thank you for getting back, i have/jad followed the client.md instructions, and same start method beinf used,
public function start() {
//echo $this->manager->validate_with()->authenticate_with()->hash_with
$this->manager
->validate_with(
array(
'license_key' => __( 'Enter a valid license key.', 'tws-license-manager-client' ),
'email' => __( 'Enter valid/same email address used at the time of purchase.', 'tws-license-manager-client' ),
'order_id' => __( 'Enter same/valid purchase order ID.', 'tws-license-manager-client' ),
//'slug' => '',
)
)
->authenticate_with(
'ck_093706f4c221e7543c7be916218dcd181bcb6f56',
'cs_02ab8e62e0d5a9199c7d659dc356044ac04972a7',
)
->hash_with( 'server-secret-key' )
->connect_with(
esc_url( self::SERVER_URL ),
array(
'timeout' => 15,
'namespace' => 'lmfwc',
'version' => 'v2',
'verify_ssl' => 2,
'query_string_auth' => true,
)
)
->disable_form( true );
}
I can see that you have not added your own secret key and used the default placeholder text instead. Please follow below instructions and check if it works?
hash_with( 'server-secret-key' )
-> The same secret key generated by License Manager for WooCommerce plugin.
-- Get crytographics secret by following docs here and setup those secret constants by following docs here.
-- Then, use same LMFWC_PLUGIN_SECRET
value on method hash_with()
replacing server-secret-key with the constant value.Request was made outside of license form.
The reason for this error is because the secret key is missing. Set them and it should work.ok Thank you for clarification hash_with( 'server-secret-key' ) was not elaborated well in CLIENT.md please reconfirm may i use LMFWC_PLUGIN_SECRET in hash_with or consumer_secret generated in license manager?
You must use LMFWC_PLUGIN_SECRET
constant value in this case.
that's great, would provide feedback, i am palying around the script, have some other issues may needs to implement some checks if in case of activated key removed from server and new license key provided, would be back for further queries. Thank you
Sure 🙂
If the current issue is not resolved, please reply. Otherwise, this issue will be assumed resolved and will be closed tomorrow.
Thank you for using this plugin.
Hello Mate, Thank you for developing this awesome stuff, While integration, i am getting error message on activation Request was made outside of license form.
please have a look at result output
test validation is working fine with debug on.