Skip to content

Commit 41dbbc9

Browse files
committed
chore(EtsyProvider): Add Provider to the Mvc.Client along test call to real api after tests have been passing
1 parent 8f0c011 commit 41dbbc9

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

samples/Mvc.Client/Startup.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* for more information concerning the license and the contributors participating to this project.
55
*/
66

7+
using AspNet.Security.OAuth.Etsy;
78
using Microsoft.AspNetCore.Authentication.Cookies;
89
using Microsoft.IdentityModel.Logging;
910

@@ -61,6 +62,20 @@ public void ConfigureServices(IServiceCollection services)
6162
{
6263
options.ClientId = configuration["Dropbox:ClientId"] ?? string.Empty;
6364
options.ClientSecret = configuration["Dropbox:ClientSecret"] ?? string.Empty;
65+
})
66+
67+
.AddEtsy(options =>
68+
{
69+
var etsySection = configuration.GetSection(nameof(EtsyAuthenticationDefaults.DisplayName)).Get<EtsyAuthenticationOptions>();
70+
if (etsySection is not null)
71+
{
72+
options.ClientId = etsySection.ClientId;
73+
options.CallbackPath = etsySection.CallbackPath;
74+
options.IncludeDetailedUserInfo = etsySection.IncludeDetailedUserInfo;
75+
76+
// Etsy's OAuth implementation does not require a client secret when using PKCE, but we get one, which is not used along the Etsy Authentication Guide, but setting is better than failing if they (and rfc standard just not told about it.
77+
options.ClientSecret = etsySection.ClientSecret;
78+
}
6479
});
6580

6681
services.AddMvc();

samples/Mvc.Client/appsettings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414
"Twitter": {
1515
"ClientId": "6XaCTaLbMqfj6ww3zvZ5g",
1616
"ClientSecret": "Il2eFzGIrYhz6BWjYhVXBPQSfZuS4xoHpSSyD9PI"
17+
},
18+
"Etsy": {
19+
"ClientId": "client-id-from-user-secrets",
20+
"ClientSecret": "client-secret-from-user-secrets",
21+
"CallbackPath": "/etsy-signin",
22+
"IncludeDetailedUserInfo": true
1723
}
1824
}

0 commit comments

Comments
 (0)