Question

is there any difference between a password and obscure field type in system.xml

<field id="secret" type="obscure" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Secret</label>
                    <validate>required-entry</validate>
                    <backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
                </field>
                <field id="passswordsecret" type="password" translate="label" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Secret Password</label>
                </field>
Was it helpful?

Solution

Obscure type is used for display value as secret text. Sometimes, user change value from inspect element and get that secret value.

Password type also same as obscure type. But, password type field can’t encrypt value as like obscure type. It used for hide value from the field. But, if user change forcefully value from inspect element then, after change they will get value which save in password type.

For syntax and example you can take reference.

OTHER TIPS

type="obscure" : You can define Obscure type using type=”obscure”. Hide value to make sure it will not show in HTML.

When you forcefully change the type from Obscure to text using Inspect element still you can’t able to see actual value for an obscure type.

Using Obscure field type you can’t check the field original value by Edit Inspect element from Backend configuration and set the type=”password” to type=”text”. You got the value of the field as ‘******’.

type="password": Password is a field with type=”password”. Its used for only hide character from the field.

Using the password field type, you can check the field value by Edit Inspect element from Backend configuration and set the type=”password” to type=”text”. You got the actual value of the field.

Reference

1. Obscure:- Hide value to make sure it will not show in HTML. When you forcefully change the type from Obscure to text using Inspect element still you can’t able to see actual value for an obscure type. It will show you the field as ‘******’.

2. Password:- It's used for only hide character from the field. Using the password field type, you can check the field value by Edit Inspect element from Backend configuration and set the type=”password” to type=”text”. It will show you actual value of the field.

An obscure field used for security purpose for all the field which have secure data like Payment API Key, API Username, API Password.

Reference

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top