1 of 11

pygeoapi-auth

authentication and authorization for pygeoapi

Youssef Harby

2 of 11

docker run --rm -p 5000:80 geopython/pygeoapi:latest

Port : 80

Port : 5000

Host

Container

http://localhost:5000

3 of 11

But what if I have sensitive data?

4 of 11

We need to protect it !

Port : 80

Port : 5000

Host

Container

Or any reverse proxy

Port : 80

Port: 443

Port : 80

Port: 443

Host

5 of 11

But what about authorization !

Can access any collection/item

Now I know you

6 of 11

The Solution!

forward authentication

7 of 11

Architecture Diagram if HTTP 200 OK

Port : 80

Port : 9001

Port: 80

Port: 443

Port: 80

Port: 443

Host

User: yharby

app.pygeoapi.local/api/collections/obs

pygeoapi.local/?rd=https://app.pygeoapi.local/api/collections/obs&rm=GET

pygeoapi.local

app.pygeoapi.local

1

2

3

HTTP 200 OK

4

5

Response

6

Response

Redirected to authelia with redirect needed endpoint in query params

Isolated Docker Network

8 of 11

Architecture Diagram HTTP 4xx KO

Port : 80

Port : 9001

Port: 80

Port: 443

Port: 80

Port: 443

Host

app.pygeoapi.local/api/collections/obs

pygeoapi.local/?rd=https://app.pygeoapi.local/api/collections/obs&rm=GET

pygeoapi.local

1

2

3

HTTP 4xx KO

4

ERROR

Redirected to authelia with redirect needed endpoint in query params

Isolated Docker Network

User: francbartoli

9 of 11

10 of 11

Todo list:

11 of 11

Q&A