Pimcore password datatype in class

I am trying to use pimcore password datatype, it’s working fine and password is stored as encrypted data. Now i need to check the correct username and password. I couldn’t match the encrypted password. I means, will get the username and password as api request, if the username and password is correct then return value.

Never done this myself, but perhaps you can find something in the members bundle.

https://pimcore.com/docs/6.x/Development_Documentation/Development_Tools_and_Details/Security_Authentication/Authenticate_Pimcore_Objects.html