Skip to content

Commit

Permalink
WIP: Authentication works, but not with calender integration yet
Browse files Browse the repository at this point in the history
  • Loading branch information
Atrejoe authored and Atreyu committed Dec 16, 2024
1 parent 971d1c7 commit abe51b1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
1 change: 1 addition & 0 deletions InkyCal.Server/InkyCal.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<PackageReference Include="Bugsnag.AspNet.Core" Version="3.1.0" />
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="Markdig.Signed" Version="0.38.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.2.2" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="9.0.0" />
Expand Down
11 changes: 11 additions & 0 deletions InkyCal.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ public static void ConfigureServices(IServiceCollection services)
)
.AddEntityFrameworkStores<ApplicationDbContext>();

if (InkyCal.Server.Config.GoogleOAuth.Enabled)
{
services.AddAuthentication()
.AddGoogle(googleOptions =>
{
googleOptions.ClientId = InkyCal.Server.Config.GoogleOAuth.ClientId;
googleOptions.ClientSecret = InkyCal.Server.Config.GoogleOAuth.ClientSecret;
googleOptions.CallbackPath = "/google/authorize";
});
}

services.AddRazorPages();
services.AddServerSideBlazor();
services.AddScoped<AuthenticationStateProvider, RevalidatingIdentityAuthenticationStateProvider<IdentityUser>>();
Expand Down
29 changes: 14 additions & 15 deletions InkyCal.Server/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,6 @@
"Microsoft.EntityFrameworkCore.Relational": "9.0.0"
}
},
"Microsoft.AspNetCore.Http": {
"type": "Direct",
"requested": "[2.2.2, )",
"resolved": "2.2.2",
"contentHash": "BAibpoItxI5puk7YJbIGj95arZueM8B8M5xT1fXBn3hb3L2G3ucrZcYXv1gXdaroLbntUs8qeV8iuBrpjQsrKw==",
"dependencies": {
"Microsoft.AspNetCore.Http.Abstractions": "2.2.0",
"Microsoft.AspNetCore.WebUtilities": "2.2.0",
"Microsoft.Extensions.ObjectPool": "2.2.0",
"Microsoft.Extensions.Options": "2.2.0",
"Microsoft.Net.Http.Headers": "2.2.0"
}
},
"Microsoft.AspNetCore.Identity.UI": {
"type": "Direct",
"requested": "[9.0.0, )",
Expand Down Expand Up @@ -811,6 +798,18 @@
"Microsoft.Extensions.Configuration.Abstractions": "2.0.0"
}
},
"Microsoft.AspNetCore.Http": {
"type": "Transitive",
"resolved": "2.0.1",
"contentHash": "mTXDCNF83pV6qe+IzJ166p1re2or25Xj0vjdqj5JDakz9ClNZHncSkyAk63vSpBZbgFXGHiz+PuVyYcfurs5ew==",
"dependencies": {
"Microsoft.AspNetCore.Http.Abstractions": "2.0.1",
"Microsoft.AspNetCore.WebUtilities": "2.0.1",
"Microsoft.Extensions.ObjectPool": "2.0.0",
"Microsoft.Extensions.Options": "2.0.0",
"Microsoft.Net.Http.Headers": "2.0.1"
}
},
"Microsoft.AspNetCore.Http.Abstractions": {
"type": "Transitive",
"resolved": "2.2.0",
Expand Down Expand Up @@ -1682,8 +1681,8 @@
},
"System.Buffers": {
"type": "Transitive",
"resolved": "4.5.0",
"contentHash": "pL2ChpaRRWI/p4LXyy4RgeWlYF2sgfj/pnVMvBqwNFr5cXg7CXNnWZWxrOONLg8VGdFB8oB+EG2Qw4MLgTOe+A=="
"resolved": "4.4.0",
"contentHash": "AwarXzzoDwX6BgrhjoJsk6tUezZEozOT5Y9QKF94Gl4JK91I4PIIBkBco9068Y9/Dra8Dkbie99kXB8+1BaYKw=="
},
"System.ClientModel": {
"type": "Transitive",
Expand Down

0 comments on commit abe51b1

Please sign in to comment.