Skip to content

Commit 3484ce2

Browse files
author
robert-knight
committed
Added quickstart auth page and redirect code
1 parent 80f876a commit 3484ce2

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

app/docusign/views.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,15 @@ def ds_callback():
7676

7777
@ds.route("/must_authenticate")
7878
def ds_must_authenticate():
79-
return render_template("must_authenticate.html", title="Must authenticate")
80-
79+
qs = DS_CONFIG["quickstart"]
80+
if qs:
81+
return redirect(url_for("ds.ds_quickstart_auth"))
82+
else:
83+
return render_template("must_authenticate.html", title="Must authenticate")
84+
85+
@ds.route(("/quickstart_auth"))
86+
def ds_quickstart_auth():
87+
return render_template("quickstart_auth.html", title = "Must authenticate")
8188

8289
@ds.route("/ds_return")
8390
def ds_return():

app/templates/quickstart_auth.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!-- extend base layout -->
2+
{% extends "base.html" %}
3+
4+
{% block content %}
5+
<div style="margin:1% 5%;">
6+
<h1 class="display-4">Please Authenticate with DocuSign</h1>
7+
8+
<form method="post" data-busy="form" action={{ url_for("ds.ds_login") }}>
9+
<div class="form-group col-md-5">
10+
<label for="auth_type">Please choose your OAuth2.0 grant type</label>
11+
<select class="form-control" id="auth_type" name="auth_type">
12+
<option value="code_grant">Authorization Code Grant</option>
13+
</select>
14+
<p class="lead" style="padding-top: .5rem;">
15+
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}"/>
16+
<button type="submit" class="btn btn-docu">Authenticate with DocuSign</button>
17+
</p>
18+
</div>
19+
</form>
20+
<hr class="my-4">
21+
<p>You need to authenticate with DocuSign to continue your request.</p>
22+
</div>
23+
{% endblock %}

app/templates/quickstarthome.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<tr>
1212
<td>
1313
<h1 class="display-4">Python Launcher</h1>
14-
<p class="Xlead">Welcome to the DocuSign Python examples using multiple OAuth flows (JWT and Authorization Code Grant).</p>
14+
<p class="Xlead">Welcome to the DocuSign Python Quickstart launcher.</p>
1515
</td>
1616
<td>
1717
<img src="/static/assets/banner-code.png" />

0 commit comments

Comments
 (0)