Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protect routes #10

Open
sirkrypt0 opened this issue Feb 27, 2021 · 4 comments
Open

Protect routes #10

sirkrypt0 opened this issue Feb 27, 2021 · 4 comments
Labels
M Medium Size security This ticket is important for security purposes. server Issues in the server

Comments

@sirkrypt0
Copy link
Contributor

We need some way of authenticating users, such that not every user is able to call all routes. Could be done using JWTs that are sent using the Authorization header.

@sirkrypt0 sirkrypt0 added the server Issues in the server label Feb 27, 2021
@frcroth
Copy link
Contributor

frcroth commented Feb 27, 2021

Possible solution:

  1. Send an authorization request (May be handled via ssh or password)
  2. On successful authorization, the server will reply an access_token
  3. All further actions have an access_token token in the request (May just be in the URL since we should use SSL anyway)
  4. The access_token is only valid for a limited time

@frcroth
Copy link
Contributor

frcroth commented Feb 27, 2021

Comparison to Matrix:
curl -XGET "https://localhost:8448/_matrix/client/r0/login"

{
    "flows": [
        {
            "type": "m.login.password"
        }
    ]
}

curl -XPOST -d '{"type":"m.login.password", "user":"example", "password":"wordpass"}' "https://localhost:8448/_matrix/client/r0/login"

{
    "access_token": "QGV4YW1wbGU6bG9jYWxob3N0.vRDLTgxefmKWQEtgGd", 
    "home_server": "localhost", 
    "user_id": "@example:localhost"
}

@frcroth
Copy link
Contributor

frcroth commented Feb 27, 2021

@frcroth frcroth added the security This ticket is important for security purposes. label Feb 27, 2021
@frcroth
Copy link
Contributor

frcroth commented Mar 3, 2021

https://github.com/Keats/jsonwebtoken

@frcroth frcroth added the M Medium Size label Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M Medium Size security This ticket is important for security purposes. server Issues in the server
Projects
None yet
Development

No branches or pull requests

2 participants