Skip to content

Commit cc4b3bf

Browse files
committed
Various updates
1 parent e1a0622 commit cc4b3bf

File tree

5 files changed

+41
-14
lines changed

5 files changed

+41
-14
lines changed

Quick_ACG/Program.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ public static IWebHostBuilder CreateWebHostBuilder(string[] args)
2828
{
2929
path = Path.GetFullPath(@"..\\launcher-csharp\\appsettings.json");
3030
}
31-
31+
3232

3333
config.AddJsonFile(path,
34-
optional: false,
35-
reloadOnChange: true);
34+
optional: false,
35+
reloadOnChange: true);
3636
});
3737
return builder;
3838
}

Quick_ACG/Quick_ACG.csproj

+7-7
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@
4747
</ItemGroup>
4848

4949
<ItemGroup>
50-
<PackageReference Include="DocuSign.Admin" Version="2.0.0-rc4" />
51-
<PackageReference Include="DocuSign.eSign.dll" Version="8.0.0-rc2" />
50+
<PackageReference Include="DocuSign.Admin" Version="2.0.0" />
51+
<PackageReference Include="DocuSign.eSign.dll" Version="8.0.0" />
5252
<PackageReference Include="Microsoft.AspNetCore.Session" Version="2.2.0" />
53-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.18" />
54-
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.29">
53+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.10" />
54+
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.10">
5555
<PrivateAssets>all</PrivateAssets>
5656
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5757
</PackageReference>
58-
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="6.0.0" />
59-
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.16" />
60-
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
58+
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.1" />
59+
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.6" />
60+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
6161
</ItemGroup>
6262

6363
<ItemGroup>

Quick_ACG/Startup.cs

+26-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
using Microsoft.Extensions.DependencyInjection;
1313
using Microsoft.Extensions.Hosting;
1414
using Newtonsoft.Json.Linq;
15+
16+
using System.Threading.Tasks;
1517
using System;
1618
using System.Net.Http;
1719
using System.Net.Http.Headers;
@@ -95,6 +97,12 @@ public void ConfigureServices(IServiceCollection services)
9597
options.ClaimActions.MapJsonKey("expires_in", "expires_in");
9698
options.Events = new OAuthEvents
9799
{
100+
OnRedirectToAuthorizationEndpoint = redirectContext =>
101+
{
102+
redirectContext.Options.UsePkce = this.Configuration["PkceFailed"] == null;
103+
redirectContext.HttpContext.Response.Redirect(redirectContext.RedirectUri);
104+
return Task.FromResult(0);
105+
},
98106
OnCreatingTicket = async context =>
99107
{
100108
var request = new HttpRequestMessage(HttpMethod.Get, context.Options.UserInformationEndpoint);
@@ -113,12 +121,27 @@ public void ConfigureServices(IServiceCollection services)
113121
{
114122
context.RunClaimActions(payload.RootElement);
115123
}
116-
}
124+
},
125+
OnRemoteFailure = async context =>
126+
{
127+
var redirectContext = new RedirectContext<OAuthOptions>(
128+
context.HttpContext,
129+
context.Scheme,
130+
options,
131+
context.Properties,
132+
this.Configuration["RedirectUrl"]);
133+
134+
this.Configuration["PkceFailed"] = "true";
135+
136+
await options.Events.OnRedirectToAuthorizationEndpoint(redirectContext);
137+
138+
context.HandleResponse();
139+
},
117140
};
118141
});
119142
}
120143

121-
#nullable enable
144+
#nullable enable
122145
private string? ExtractDefaultAccountValue(JsonElement obj, string key)
123146
{
124147
if (!obj.TryGetProperty("accounts", out var accounts))
@@ -166,7 +189,7 @@ public void ConfigureServices(IServiceCollection services)
166189

167190
return keyValue;
168191
}
169-
#nullable disable
192+
#nullable disable
170193

171194
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
172195
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ steps:
107107
command: build
108108
repository: 'launcher-automation-csharp'
109109
dockerfile: '$(Build.SourcesDirectory)/code-examples-csharp-private/Dockerfile'
110-
buildContext: '$(Build.SourcesDirectory)/code-examples-csharp-private '
110+
buildContext: '$(Build.SourcesDirectory)/code-examples-csharp-private'
111111
tags: |
112112
latest
113113

manifest/CodeExamplesManifest.json

+4
Original file line numberDiff line numberDiff line change
@@ -1922,6 +1922,10 @@
19221922
{
19231923
"Name":"create_web_form",
19241924
"ResultsPageText":"Go to your Docusign account to create the Web Form. Go to 'Templates' in your developer account, select 'Start,' select 'Web Forms,' and choose 'Upload Web Form.' Upload the JSON config file 'web-form-config.json' found under the {0} folder of this project. You will need to activate the web form before proceeding. Press Continue after doing so."
1925+
},
1926+
{
1927+
"Name":"webforms_heading",
1928+
"ResultsPageText": "The webform has been embedded below using the Docusign JS library."
19251929
}
19261930
]
19271931
}

0 commit comments

Comments
 (0)