我可以使用 JWT pyramid-jwt 和 SessionAuthenticationPolicy 配置金字塔的主应用程序吗
Can i config Main App of Pyramid with JWT pyramid-jwt and SessionAuthenticationPolicy
当我尝试配置金字塔的主要应用程序时遇到问题:
在我的配置之前:(我在金字塔会话中有身份验证)
authn_policy = SessionAuthenticationPolicy()
authz_policy = ACLAuthorizationPolicy()
# configuration de pyramid : on utilise le données renseignées dans le
# fichier de config (settings), les données d'authentification
config = Configurator(
settings=settings,
root_factory=RootFactory,
authentication_policy=authn_policy,
authorization_policy=authz_policy,
session_factory=session_factory,
)
然后当我尝试添加 JWT 配置时它不起作用,因为我已经 authentication_policy=authn_policy,上面 :
# New configuration of JWT authentification for Pyramid
# Enable JWT authentication.
config.include('pyramid_jwt')
config.set_jwt_authentication_policy('secret')
我想同时使用身份验证解决方案 SessionAuthentificationPolicy 和 pyramid-jwt ?
错误:pyramid.exceptions.ConfigurationConflictError:配置操作冲突
据我所知,Pyramid 不支持开箱即用的多个身份验证策略。 https://github.com/mozilla-services/pyramid_multiauth 可能会有帮助。
当我尝试配置金字塔的主要应用程序时遇到问题: 在我的配置之前:(我在金字塔会话中有身份验证)
authn_policy = SessionAuthenticationPolicy()
authz_policy = ACLAuthorizationPolicy()
# configuration de pyramid : on utilise le données renseignées dans le
# fichier de config (settings), les données d'authentification
config = Configurator(
settings=settings,
root_factory=RootFactory,
authentication_policy=authn_policy,
authorization_policy=authz_policy,
session_factory=session_factory,
)
然后当我尝试添加 JWT 配置时它不起作用,因为我已经 authentication_policy=authn_policy,上面 :
# New configuration of JWT authentification for Pyramid
# Enable JWT authentication.
config.include('pyramid_jwt')
config.set_jwt_authentication_policy('secret')
我想同时使用身份验证解决方案 SessionAuthentificationPolicy 和 pyramid-jwt ?
错误:pyramid.exceptions.ConfigurationConflictError:配置操作冲突
据我所知,Pyramid 不支持开箱即用的多个身份验证策略。 https://github.com/mozilla-services/pyramid_multiauth 可能会有帮助。