"""Test_authentication.""" import base64 import jwt from flask import Flask from flask.testing import FlaskClient from tests.spiffworkflow_backend.helpers.base_test import BaseTest class TestFlaskOpenId(BaseTest): """An integrated Open ID that responds to openID requests. By referencing a build in YAML file. Useful for local development, testing, demos etc... """ def test_discovery_of_endpoints( self, app: Flask, client: FlaskClient, with_db_and_bpmn_file_cleanup: None, ) -> None: """Test discovery endpoints.""" response = client.get("/openid/.well-known/openid-configuration") discovered_urls = response.json assert "http://localhost/openid" == discovered_urls["issuer"] assert ( "http://localhost/openid/auth" == discovered_urls["authorization_endpoint"] ) assert "http://localhost/openid/token" == discovered_urls["token_endpoint"] def test_get_login_page( self, app: Flask, client: FlaskClient, with_db_and_bpmn_file_cleanup: None, ) -> None: """It should be possible to get to a login page.""" data = {"state": {"bubblegum": 1, "daydream": 2}} response = client.get("/openid/auth", query_string=data) assert b"