Skip to content

Commit

Permalink
update backend readme for explanation authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
reyniersbram committed Mar 6, 2024
1 parent 053d678 commit d368da6
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions backend/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
## Run the backend api
# Backend API

### Setup
## Running the API

#### In this directy execute the following command to create a python environment:
### Setup

```sh
# Create a python virtual environment
python -m venv venv
```

#### Activate the environment:

```sh
# Activate the environment
source venv/bin/activate
```

#### Install the dependencies:

```sh
# Install dependencies
pip install -r requirements.txt
```

Expand All @@ -26,6 +19,8 @@ pip install -r requirements.txt
api_url: https://localhost:8080
cas_server_url: https://login.ugent.be
database_uri: "database connection string: postgresql://..., see discord..."
secret_key: "<secret key to sign JWT tokens>"
algorithm: "<algorithm used to sign JWT tokens>"
```
### Usage
Expand All @@ -52,7 +47,16 @@ source venv/bin/activate
It will start a local development server on port `8080`

## The API

## Login

The `/api/login` endpoint will redirect the user to a CAS login page. After
authentication, a [JWT](https://jwt.io/) token will be returned to the user.
This token has to be send in the `Authorization` header of each request to
access protected endpoints.

## Developing

#### To format the python code in place to conform to PEP 8 style:

Expand Down

0 comments on commit d368da6

Please sign in to comment.