Login by MAC and external page process

Hello everyone,
I’m beginner in MikroTik configuration so I have a question about login process.

I need configure device to login in external page, i read tutorial how can i do it. I can use default login page and redirect by post to my page but i don’t want to use login and password. I want to accept access by MAC adress by my external page.

Process that i need:

  1. First access to device - redirect to external page (it’s easy with Hotspot)
  2. My page should decide to allow or denny access by client mac adress, allow trial access too
  3. With some magic kind I need login/allow access user in router
  4. Trial user should be redirect to login page after some period of time (like first access)
  5. Normal users should have access by the time disconnecting from wifi

That I think it is impossible with User Manager so maybe I should use API to add MAC to whitelist from my page and clean whitelist sometimes? Maybe is it possible with User Manager?

I don’t need done solutions, only please help with choose the best way / alternatives for this problem.

Thanks a lot