implement auth_api for credential()