Python DocuSign API在示例应用程序上收到重定向URI错误 [英] Python DocuSign API receiving redirect URI error on the sample app

查看:117
本文介绍了Python DocuSign API在示例应用程序上收到重定向URI错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行Python和React MyUni Education示例应用程序,并将其加载到我的localhost3000中。当我单击登录名时,虽然它给了我重定向错误。

I am running the Python and React MyUni Education sample app and have it loading in my localhost3000. When I click on the logins though it is giving me redirect error.

我创建了一个新的Docusign集成密钥,以防万一我先前的设置中配置有误,但错误仍然存​​在。相同:
重定向URI未正确向DocuSign注册错误

I created a new Docusign integration key in case there was something incorrectly configured in my previous set up, but the error remains the same: "The redirect URI is not registered properly with DocuSign" error


Docusign沙箱配置为:
重定向URI http:// localhost:5001 / api

Docusign sandbox configured with: Redirect URIs "http://localhost:5001/api"

.env文件,我相信设置了正确的环境变量,但是请让我知道是否遗漏任何东西。

.env file I believe has the right environment variables set but please let me know if I am missing anything.

# Configuration file for the example
DS_CLIENT_ID=blank
DS_CLIENT_SECRET=blank
DS_IMPERSONATED_USER_GUID=blank
DS_TARGET_ACCOUNT_ID=false
DS_PAYMENT_GATEWAY_ID=blank
DS_PAYMENT_GATEWAY_NAME=Stripe
DS_PAYMENT_GATEWAY_DISPLAY_NAME=Stripe
DS_PRIVATE_KEY=blank

# React environment variables
**REACT_APP_DS_RETURN_URL=http://localhost:3000
REACT_APP_API_BASE_URL=http://localhost:5001/api**
REACT_APP_DS_AUTH_SERVER=https://account-d.docusign.com

# Demo Docusign API URL
REACT_APP_DS_DEMO_SERVER=https://demo.docusign.net
REACT_APP_DS_CLICKWRAP_URL=//demo.docusign.net/clickapi/sdk/latest/docusign-click.js

我认为它正在影响JWT,因为当我选择继续进行预配置的登录时,我收到请求失败,状态码为500错误。从下面的日志。

I believe it is affecting the JWT, as when I selected the "continue with a preconfigured login" I received a "Request failed with status code 500" error as well. Logs from that below.

PS C:\Users\windowsuser\OneDrive\Documents\GitHub\sample-app -myuni> flask run --port 5001

PS C:\Users\windowsuser\OneDrive\Documents\GitHub\sample-app-myuni> flask run --port 5001

 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5001/ (Press CTRL+C to quit)
127.0.0.1 - - [27/Jul/2020 16:13:20] "GET /api/get_status HTTP/1.1" 200 -
127.0.0.1 - - [27/Jul/2020 16:13:51] "GET /api/code_grant_auth HTTP/1.1" 401 -
127.0.0.1 - - [27/Jul/2020 16:14:03] "OPTIONS /api/jwt_auth HTTP/1.1" 200 -
[2020-07-27 16:14:04,237] ERROR in app: Exception on /api/jwt_auth [POST]
Traceback (most recent call last):
  File "c:\python38\lib\site-packages\flask\app.py", line 2446, in wsgi_app
    response = self.full_dispatch_request()
  File "c:\python38\lib\site-packages\flask\app.py", line 1951, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "c:\python38\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "c:\python38\lib\site-packages\flask\app.py", line 1820, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "c:\python38\lib\site-packages\flask\_compat.py", line 39, in reraise
    raise value
  File "c:\python38\lib\site-packages\flask\app.py", line 1949, in full_dispatch_request
    rv = self.dispatch_request()
  File "c:\python38\lib\site-packages\flask\app.py", line 1935, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "c:\python38\lib\site-packages\flask_cors\decorator.py", line 128, in wrapped_function
    resp = make_response(f(*args, **kwargs))
  File "C:\Users\windowsuser\OneDrive\Documents\GitHub\sample-app-myuni\app\api\auth.py", line 43, in jwt_auth
    DsClient.update_token()
  File "C:\Users\windowsuser\OneDrive\Documents\GitHub\sample-app-myuni\app\ds_client.py", line 36, in update_token
    client.request_jwt_user_token(DsConfig.client_id(),
  File "c:\python38\lib\site-packages\docusign_esign\client\api_client.py", line 679, in request_jwt_user_token
    raise ArgumentException("Private key not supplied or is invalid!")
  File "c:\python38\lib\site-packages\docusign_esign\client\api_exception.py", line 51, in __init__
    super(Exception).__init__(*args, **kwargs)
TypeError: super() argument 1 must be type, not str
127.0.0.1 - - [27/Jul/2020 16:14:04] "POST /api/jwt_auth HTTP/1.1" 500 -
127.0.0.1 - - [27/Jul/2020 16:18:14] "GET /api/code_grant_auth HTTP/1.1" 401 -


推荐答案

集成密钥设置必须与$ b完全匹配$ b我认为您可以检查出现此错误的URL,它首先具有您创建的IK(GUID值以61C9开头),然后具有redirectUri。它是URI编码的,但是您可以弄清楚它,并确保在DocuSign Developer帐户的IK设置中设置了完全相同的匹配URI。
我认为这是前端的localhost:3000,而不是后端的localhost:5001,也许在下面有一个端点,只需检查并确认并添加它,等待30秒钟然后重试。

The integration key settings must match exactly I think what you can check the URL where you get this error, it has first the IK which you created (GUID value starting with 61C9) then it has the redirectUri. It is URI encoded, but you can figure it out and make sure the same exact matching URI is set in the IK settings in the DocuSign Developer account. I think it's the localhost:3000 for the front-end and not the localhost:5001 for the back-end and maybe there's an endpoint under there, just check and confirm and add it, wait 30 seconds and try again.

这篇关于Python DocuSign API在示例应用程序上收到重定向URI错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆