From da57ac8cb3daf5d14841c0c3b6d0261a49c69504 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Sat, 21 Jan 2023 03:16:05 +0300 Subject: auth: Fix saving of scope values. Add scope items. --- gn3/auth/authentication/oauth2/models/oauth2token.py | 2 +- main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gn3/auth/authentication/oauth2/models/oauth2token.py b/gn3/auth/authentication/oauth2/models/oauth2token.py index 8b73e59..9495df4 100644 --- a/gn3/auth/authentication/oauth2/models/oauth2token.py +++ b/gn3/auth/authentication/oauth2/models/oauth2token.py @@ -120,7 +120,7 @@ def save_token(conn: db.DbConnection, token: OAuth2Token) -> None: "token_type": token.token_type, "access_token": token.access_token, "refresh_token": token.refresh_token, - "scope": token.get_scope(), + "scope": token.scope, "revoked": 1 if token.revoked else 0, "issued_at": int(token.issued_at.timestamp()), "expires_in": token.expires_in, diff --git a/main.py b/main.py index d55bd42..1c810a1 100644 --- a/main.py +++ b/main.py @@ -77,7 +77,7 @@ def init_dev_clients(): "default_redirect_uri": "http://localhost:5033/oauth2/code", "redirect_uris": ["http://localhost:5033/oauth2/code"], "response_type": "token", # choices: ["code", "token"] - "scope": ["profile", "resource", "register-client"] + "scope": ["profile", "group", "role", "resource", "register-client"] }), "user_id": "0ad1917c-57da-46dc-b79e-c81c91e5b928"},) -- cgit v1.2.3