def configure_oidc(app, overrides=None): """ NOTE: app must have loaded keypairs already as ``app.keypairs``. """ overrides = overrides or {} settings = { "OAUTH2_JWT_KEY": keys.default_private_key(app), "OAUTH2_JWT_ISS": app.config["BASE_URL"], } settings.update(overrides)
def _set_authlib_cfgs(app): # authlib OIDC settings # key will need to be added settings = {"OAUTH2_JWT_KEY": keys.default_private_key(app)} app.config.update(settings) config.update(settings) # only add the following if not already provided config.setdefault("OAUTH2_JWT_ENABLED", True) config.setdefault("OAUTH2_JWT_ALG", "RS256") config.setdefault("OAUTH2_JWT_ISS", app.config["BASE_URL"]) config.setdefault("OAUTH2_PROVIDER_ERROR_URI", "/api/oauth2/errors") app.config.setdefault("OAUTH2_JWT_ENABLED", True) app.config.setdefault("OAUTH2_JWT_ALG", "RS256") app.config.setdefault("OAUTH2_JWT_ISS", app.config["BASE_URL"]) app.config.setdefault("OAUTH2_PROVIDER_ERROR_URI", "/api/oauth2/errors")