How do I make users login using the POST API

I’d like to make users login using the /login API request.

My goal is to use a custom login page and then redirect users to their mailbox after inputting their email and password

I planned to achieve this using the https://{host}/admin/login POST request, and then get the API key, and redirect users to

https://{{host}}/mail/?_task=mail&_token={{API_KEY}}

I tried this on Postman and I get an API Key, but when I try using the API_KEY, I get a ‘session expired or invalid’ message.

Any solution to this please?

The https://{host}/admin/login us for the management portal, while the https://{{host}}/mail/?_task=mail&_token={{API_KEY}} is for the Roundcube mail login. Although in the end they use the same user database in the background, these logins are not linked, so this won’t work.

Might it not be easier to customize the Roundcube login page?

Thanks for the response. I tried the suggestion but I can’t seem to find the page to the login on the server

I’m not sure the API was made for this intention.

What login do you mean? To login to the webmail, use {{host}}/mail There is a login portal there.

How would I be able to customize that page please? I mean the page at https://{{host}}/mail

I’ve never done it but I would start reading:

Don’t forget that Mailinabox resets the configuration on upgrade, so keep in mind to restore your modifications after an upgrade.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.