mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 02:28:26 -04:00
merge from main
This commit is contained in:
@@ -17,6 +17,7 @@ from flask import (
|
||||
)
|
||||
from flask_login import current_user
|
||||
|
||||
|
||||
from app import login_manager, user_api_client
|
||||
from app.main import main
|
||||
from app.main.forms import LoginForm
|
||||
@@ -41,8 +42,7 @@ def _get_access_token(code, state):
|
||||
"exp": int(time.time()) + (10 * 60),
|
||||
}
|
||||
|
||||
jwt_instance = jwt.PyJWT()
|
||||
token = jwt_instance.encode(payload, keystring, algorithm="RS256")
|
||||
token = jwt.encode(payload, keystring, algorithm="RS256")
|
||||
base_url = f"{access_token_url}?"
|
||||
cli_assert = f"client_assertion={token}"
|
||||
cli_assert_type = "client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer"
|
||||
|
||||
@@ -1,26 +1,23 @@
|
||||
import os
|
||||
import uuid
|
||||
|
||||
import requests
|
||||
from flask import redirect, url_for, current_app
|
||||
from flask import current_app, redirect, url_for
|
||||
from flask_login import current_user
|
||||
|
||||
from app.main import main
|
||||
|
||||
# import uuid
|
||||
|
||||
def _sign_out_at_login_dot_gov():
|
||||
|
||||
base_url = "https://idp.int.identitysandbox.gov/openid_connect/logout?"
|
||||
client_id = (
|
||||
f"client_id={os.getenv('LOGIN_DOT_GOV_CLIENT_ID')}"
|
||||
)
|
||||
client_id = f"client_id={os.getenv('LOGIN_DOT_GOV_CLIENT_ID')}"
|
||||
post_logout_redirect_uri = "post_logout_redirect_uri=http://localhost:6012/sign-in"
|
||||
|
||||
# TODO If I take this url and put it in the browser, login.gov sign out works properly
|
||||
# TODO But with this code it results in a 404 error message and we don't sign out from login.gov
|
||||
url = f"{base_url}&{client_id}&{post_logout_redirect_uri}"
|
||||
url = f"{base_url}{client_id}&{post_logout_redirect_uri}"
|
||||
current_app.logger.info(f"url={url}")
|
||||
response = requests.post(url, headers={'User-Agent': 'Custom'})
|
||||
response = requests.post(url, headers={"User-Agent": "Custom"})
|
||||
current_app.logger.info(f"login.gov response: {response.text}")
|
||||
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<meta property="og:site_name" content="Notify.gov">
|
||||
<meta property="og:image" content="{{ asset_url('images/usa-opengraph-image.png') }}">
|
||||
{% endblock %}
|
||||
<!-- <script type="text/javascript" src="{{ asset_url('js/gtm_head.js') }}"></script> -->
|
||||
<script type="text/javascript" src="{{ asset_url('js/gtm_head.js') }}"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block pageTitle %}
|
||||
|
||||
Reference in New Issue
Block a user