def init_app(config_file, name=None, **kwargs) -> Flask: name = name or __name__ app = Flask(name, static_url_path='', **kwargs) app.srv_config = create_from_config_file(Configuration, entity_conf=[{ "class": FedEntityConfiguration, "attr": "federation", "path": ["federation"] }], filename=config_file, base_path=dir_path) # app.users = {'test_user': {'name': 'Testing Name'}} try: from .views import intermediate except ImportError: from views import intermediate app.register_blueprint(intermediate) # Initialize the oidc_provider after views to be able to set correct urls app.server = init_entity(app.srv_config.federation, dir_path) return app
def oidc_provider_init_app(op_config, name=None, **kwargs): name = name or __name__ app = Flask(name, static_url_path='', **kwargs) app.srv_config = op_config try: from .views import oidc_op_views except ImportError: from views import oidc_op_views app.register_blueprint(oidc_op_views) # Initialize the oidc_provider after views to be able to set correct urls app.server = init_oidc_op(app) return app