bos21001 / fin-track

A personal financial management web application that allows users to create multiple financial plans for organizing accounts, tracking monthly expenses and income, and visualizing financial data. Built in Laravel with a RESTful API for future integrations.
MIT License
0 stars 0 forks source link

Set Up Basic Authentication #7

Closed bos21001 closed 5 days ago

bos21001 commented 5 days ago
bos21001 commented 5 days ago

The application now integrates Laravel Passport for authentication, providing secure API access with OAuth2. For further details on implementation, see the Apiato documentation.

API Endpoints:

  1. Login (Password Grant with Proxy)

    • Use this endpoint to authenticate users and retrieve an access token.
      curl --location 'http://api.fin-track.local/v1/clients/web/login' \
      --header 'Accept: application/json' \
      --header 'Content-Type: application/json' \
      --data-raw '{
      "email": "admin@admin.com",
      "password": "admin"
      }'
  2. Token Refresh

    • This endpoint refreshes an expired access token using a valid refresh token.
      curl --location 'http://api.fin-track.local/v1/clients/web/refresh' \
      --header 'Accept: application/json' \
      --header 'Content-Type: application/json' \
      --data '{
      "refresh_token": "<your_refresh_token_here>"
      }'
  3. Logout

    • Securely log out the user by invalidating the current access token.
      curl --location --request POST 'http://api.fin-track.local/v1/logout' \
      --header 'Authorization: Bearer <your_access_token_here>' \
      --header 'Accept: application/json'

These endpoints establish a secure login, token refresh, and logout process, ensuring robust authentication for our application. Let us know if further clarification is needed.