在moziila_django_oidc中更改redirect_uri的方法如下:
redirect_uri
参数来覆盖默认的重定向URI。例如:from mozilla_django_oidc.views import OIDCAuthenticationCallbackView
class MyOIDCAuthenticationCallbackView(OIDCAuthenticationCallbackView):
def get_redirect_uri(self, request):
# 在这里根据需要动态设置重定向URI
return "https://example.com/my-custom-redirect-uri"
在上面的示例中,我们创建了一个自定义的OIDCAuthenticationCallbackView,并重写了get_redirect_uri
方法来返回自定义的重定向URI。
请注意,以上步骤仅适用于moziila_django_oidc库,如果你使用的是其他OIDC库或身份提供商,具体的配置步骤可能会有所不同。
领取专属 10元无门槛券
手把手带您无忧上云