I figured it out. In the table mdl_user there is an auth column which shows the authentication method. I used this query to get the user:
SELECT username, lastname, firstname, email
FROM `mdl_user`
WHERE `auth` = 'saml2'
SELECT username, lastname, firstname, email
FROM `mdl_user`
WHERE `auth` = 'saml2'