# How to check Secret password in DeviceExtensionPoint

**URL:** <https://forum.inductiveautomation.com/t/how-to-check-secret-password-in-deviceextensionpoint/110643>\
**Category:** Module Development\
**Tags:** ignition81\
**Created:** [September 15, 2025, 10:33pm UTC](https://forum.inductiveautomation.com/t/how-to-check-secret-password-in-deviceextensionpoint/110643 "2025-09-15T22:33:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [September 15, 2025, 10:33pm UTC](https://forum.inductiveautomation.com/t/how-to-check-secret-password-in-deviceextensionpoint/110643/1 "2025-09-15T22:33:02Z")

</div>

**Ignition 8.3**

I try to check a password parameter has the minimal lenght in a **DeviceExtensionPoint**

But at gateway startup I have a NPE on opcua module, on line Secret.create(deviceContext.getGatewayContext() because the deviceContext is NULL.

How can we retrieve the **GatewayContext** in validate method ?

or is there another way th chceck the password length ?

```  
public class MyDevice3ExtensionPoint extends DeviceExtensionPoint {

```java
@Override
protected Device createDevice(
        DeviceContext context, DeviceProfileConfig profileConfig, DeviceDriverSNMPV3SettingsResource deviceConfig) {
        
    deviceContext = context;
    deviceDriver = new DeviceDriverSNMPV3(context,deviceConfig);

    return deviceDriver;
}

...

@Override
protected void validate(DeviceDriverSNMPV3SettingsResource config, Builder errors) {
    try {

        errors.checkField
                (Secret.create(deviceContext.getGatewayContext(), config.PrivPassphrase()).getPlaintext().getAsString().length()>=8,
                "Privacy.PrivProtocol",
                "PrivProtocol requires to have a minimum length of 8 bytes."
        );
    } catch (SecretException e) {
        throw new RuntimeException(e);
    }
}

```

```

```python

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 15, 2025, 10:56pm UTC](https://forum.inductiveautomation.com/t/how-to-check-secret-password-in-deviceextensionpoint/110643/2 "2025-09-15T22:56:28Z")

</div>

Try passing a GatewayContext into your DeviceExtensionPoint when you create it. I think `AbstractDeviceModuleHook::getGatewayHook` will be non-null by the time `getExtensionPoints()` is called.

Otherwise you'll have to do what many modules do and store a globally available reference to the GatewayContext that you can retrieve from parts of your module. You are given a GatewayContext in `GatewayModuleHook::setup`.
