Public Endpoints

The BeAPI Framework provides public endpoints for simplifying authentication/authorization. Below is a list of those endpoints and what each one does


/authenticate

The /authenticate endpoint is where you login with you username/password credentials

curl -v -c ./cookies.txt -H "Content-Type: application/json" -X POST -d '{"username":"YOUR_USERNAME","password":"YOUR_PASSWORD"}' http://YOURSITE:8080/authenticate

Output:

{"token":"eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImV4cCI6MTY2MDA4NzM1OSwiaWF0IjoxNjYwMDY5MzU5fQ.bR8lgrGlzCmHKhXC1D_LF-vVmFINAVX9kgA2n-EiIbslYaix......"}
Param Name Type Description
username String login username
password String login password

/register & /validate

/register & /validate are a three-part process. First someone must register, then an email is sent to them wherein they must click on a link to validate.

/register

curl -v -c ./cookies.txt -H "Content-Type: application/json" -X POST -d '{"username":"YOUR_USERNAME","password":"YOUR_PASSWORD", "email":"YOU_EMAIL}' http://YOURSITE:8080/register

Output:

Param Name Type Description
username String login username
password String login password
email String account email

/validate

http://YOURSITE:8080/validate?id=f2fr2fq13f3qf3wgwdfbdrh

Output:



/forgotPassword

/forgotPassword & /resetPassword work together with /validate to create a secure way to reset your password

curl -v -c ./cookies.txt -H "Content-Type: application/json" -X POST -d '{"email":"YOUR_EMAIL"}' http://YOURSITE:8080/forgotPassword

Output:

Param Name Type Description
email String account email