@Vidd, The new method of storing password is the passwordstore which is detailed in How to work with users, roles, and storage passwords using the Splunk SDK for Python. A good example is of working with the passwordstore is the splunk-add-on-jira-alerts built by Splunk. While the example is for an alert it can easily be converted for a modular input. You will need to obtain the auth key inside your modular input which is a property available in self
Take a close look at splunk-add-on-jira-alerts/bin/jiraalertsinstallendpoint.py for the setup view and splunk-add-on-jira-alerts/bin/jirahelpers.py.