# API - verify username and password

**URL:** <https://forum.bubble.io/t/api-verify-username-and-password/185598>\
**Category:** APIs\
**Created:** [January 9, 2022, 3:28pm UTC](https://forum.bubble.io/t/api-verify-username-and-password/185598 "2022-01-09T15:28:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wolfgang.korosec](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@wolfgang.korosec](https://forum.bubble.io/u/wolfgang.korosec)\
**Post date:** [January 9, 2022, 3:28pm UTC](https://forum.bubble.io/t/api-verify-username-and-password/185598/1 "2022-01-09T15:28:28Z")

</div>

Dear Bubblers,  
I am new to [bubble.io](http://bubble.io) and I am very impressed by this tool and its vibrant community.  
We are working on a project with has to to with the processing of environmental data. The backend uses Postgres as a database and PostgREST ([www.postgrest.org](http://www.postgrest.org)) to expose a REST API.  
It was very easy to set up the connection between Bubble and our backend system using the standard bubble API Connector.

I have an API function which handles authentication.  
The call looks like this:  
curl “[https://myserver.net/rpc/check\_password](https://myserver.net/rpc/check_password)” -X POST -H “Content-Type: application/json” -d ‘{ “username”: “donaldduck”, “password”: “topsecret” }’  
The API answers in case of sucess  
{“login”:true,“jwt”:“eyKXbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoidG9kb191c2VyIn0.bsfiSdmAwRvrHG2QcBFPzFr4-11c7fX-iU7IVJcQcK8”}  
in case of failure:  
{“login”:false,“jwt”:"-"}  
I want to set up a simple login-page which asks for username and password and has a “Login” button. After a successful login the user should see another page - in case of wrong username/password the user should see an error message on the login page.

I went through the bubble tutorials and docs and have experience with software and web development and frameworks like Django, but at the moment I dont know how to start here - probably a simple thing for the Bubble - gurus 😉

Here my questions:

1. In the Bubble API definition page: apropriate type “Action” or “Data” ?
2. Bubble API definition page: POST - how to hand over the values for the keys “username” and “password” (from the input fields) ?
3. What actions should be triggered by the “button is clicked” event to get the login=true/false answer from the api ?
4. What is the right place to store the JWT string. (The JWT is needed for subsequent API calls) ?

Final remark: using the Bubble -native user-management is no option for that usecase.

Many thanks in advance for your support !  
I promise to publish the solution here - as soon I found it out 😉

Best regards  
Wolfgang
