# Fortigate (FortiOS) API Token Encryption (AAP)

**URL:** <https://forum.ansible.com/t/fortigate-fortios-api-token-encryption-aap/37554>\
**Category:** AWX Project\
**Tags:** aap\
**Created:** [January 17, 2023, 11:29am UTC](https://forum.ansible.com/t/fortigate-fortios-api-token-encryption-aap/37554 "2023-01-17T11:29:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameume](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rameume](https://forum.ansible.com/u/rameume)\
**Post date:** [January 17, 2023, 11:29am UTC](https://forum.ansible.com/t/fortigate-fortios-api-token-encryption-aap/37554/1 "2023-01-17T11:29:49Z")

</div>

Hello All,  
I am using Ansible Automation Platform Trail Verson. Wanted to know if possible to encrypt API Token which is Part of Playbook Execution. Don’t want to keep in variable file which will be part of Playbook Folder.

---

<div class="post-metadata">

**Author:** ![kurokobo1](https://avatars.discourse-cdn.com/v4/letter/k/f0a364/32.png) [@kurokobo1](https://forum.ansible.com/u/kurokobo1)\
**Post date:** [January 17, 2023, 12:06pm UTC](https://forum.ansible.com/t/fortigate-fortios-api-token-encryption-aap/37554/2 "2023-01-17T12:06:00Z")

</div>

Hi,

To achieve your goal, my recommendation is defining new Custom Credential Type for Fortigate.  
This allows any string to be stored encrypted and passed to Job as an arbitrary Extra Variable or Environment Variable, similar to the built-in credential type.

[https://docs.ansible.com/automation-controller/latest/html/userguide/credential\_types.html](https://docs.ansible.com/automation-controller/latest/html/userguide/credential_types.html)

---

<div class="post-metadata">

**Author:** ![rameume](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rameume](https://forum.ansible.com/u/rameume)\
**Post date:** [January 17, 2023, 1:11pm UTC](https://forum.ansible.com/t/fortigate-fortios-api-token-encryption-aap/37554/3 "2023-01-17T13:11:11Z")

</div>

Thanks for you help. Started Creating Cred Type
