-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6c2eeb
commit 2ae86a3
Showing
1 changed file
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
|
||
from cg.server.ext import db | ||
from cg.store.models import User | ||
from cg.server.ext import keycloak_openid_client | ||
|
||
|
||
LOG = logging.getLogger(__name__) | ||
|
||
|
@@ -24,6 +26,11 @@ def public_endpoint(*args, **kwargs): | |
return public_endpoint | ||
|
||
|
||
def test_keycloak_auth(): | ||
token = keycloak_openid_client.token("[email protected]", "password") | ||
print(f"keycloak token {token}") | ||
|
||
|
||
def before_request(): | ||
"""Authorize API routes with JSON Web Tokens.""" | ||
if not request.is_secure: | ||
|
@@ -45,6 +52,7 @@ def before_request(): | |
) | ||
|
||
jwt_token = auth_header.split("Bearer ")[-1] | ||
test_keycloak_auth() | ||
# # replace | ||
# try: | ||
# user_data = verify_google_token(jwt_token) | ||
|