Hello World Authentication
BOSA Authentication Example App
git clone https://github.com/GDP-ADMIN/bosa-example-apps.git
cd bosa-authentication-example-app▶️ Execute the script for installing and start the dependencies
./start-dependencies.sh⬆️ This script will do the following:
Check that required commands (Python and Poetry) are installed and meet specified version requirements.
Copy configuration
.envfiles from templates if they do not already exist.Deactivate any active Conda environments to avoid conflicts.
Install project dependencies using a Makefile.
Start project dependencies (like Docker containers) as required for the application to run.
🚀 Then run the app
🛑 Run this script for stop the running dependencies:
Here's the endpoints for our example apps FastAPI (or you can open http://localhost:8000/docs) for you to play around.
API Endpoints
Client Management
Create Client
POST
/clientBody:
{"name": "My App"}Response: Client object with API key
Verify Client API Key
GET
/client/verifyHeaders:
x-api-keyResponse:
{"valid_key": true/false}
User Management
Create User
POST
/usersHeaders:
x-api-keyBody:
{"identifier": "user@example.com"}Response: User object
Get User by Identifier
GET
/users/{identifier}Headers:
x-api-keyResponse: User object
Get User with Integrations
GET
/users/integrationsHeaders:
x-api-key,Authorization: Bearer {token}Response: Complete user object with integrations
Authentication
Authenticate User (Login)
POST
/users/authenticateHeaders:
x-api-keyBody:
{"identifier": "user@example.com", "secret": "password"}Response: Access token and user info
Verify Token
GET
/users/verifyHeaders:
x-api-key,Authorization: Bearer {token}Response:
{"user_id": "user_123"}
Revoke Token (Logout)
POST
/users/revokeHeaders:
x-api-key,Authorization: Bearer {token}Response: Success message
Last updated