You could add a collision box to the door actor that creates the widget on overlap with pawn.
Then in the widget use an enterable text.
That has an event “on text changed” where you could check against a password text variable.
Set the password text variable to be expose on spawn and instance editable, so you can set it in door bp when you create the widget on overlap.
Also might want to check on tick the distance from the door to the character and remove the widget if out of range.