Hey @ylu, Welcome to the Auth0 Community!
We have quite a exhaustive set of documentation for the custom login scripts:
https://auth0.com/docs/connections/database/custom-db/templates/create
but client_id is available as a contextual information in Rules.