When transport security is enabled in a security policy, we will not able to remove create_identity when creating a security token file. An alternative way to avoid asking for a password is to add "encrypt false" when creating the security token.
Example.
create security_token domain_name "mydomain" policy_file "mypolicy.txt" create_identity encrypt false token_file "sample_token_test.txt" .
encrypt (optional):
Used with the create_identity parameter.
A boolean value which indicates whether the private key should be encrypted. (default: true).