Keycloak rewrite spi question

Hello,I rewrite a user storage provider.However,my isvalid method can not get username,and the username of usermodel is null.So,I want to ask some solution for this problem,Thanks!