Skip to content

Commit

Permalink
Merge branch 'main' into feat/upgrade-stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
buehler authored Oct 28, 2024
2 parents 7963da4 + 906c1bb commit 9266a1f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-grpc": {
"version": "2.60.0",
"version": "2.66.0",
"commands": [
"dotnet-grpc"
]
Expand Down
9 changes: 6 additions & 3 deletions examples/Zitadel.AspNet.AuthN/Pages/Authenticated.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ namespace Zitadel.AspNet.AuthN.Pages;
[Authorize]
public class Authenticated : PageModel
{
public async Task<IActionResult> OnPostAsync()
public async Task OnPostAsync()
{
await HttpContext.SignOutAsync();
return RedirectToPage("/Index");
await HttpContext.SignOutAsync("Identity.External"); // Options: signs you out of ZITADEL entirely, without this you may not be reprompted for your password.
await HttpContext.SignOutAsync(
ZitadelDefaults.AuthenticationScheme,
new AuthenticationProperties { RedirectUri = "http://localhost:8080/loggedout" }
);
}
}
13 changes: 13 additions & 0 deletions examples/Zitadel.AspNet.AuthN/Pages/LoggedOut.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@page
@model LoggedOutModel

<html lang="en">
<head>
<title>Logged out</title>
</head>
<body>
<div>
<p>You are now logged out.</P>
</div>
</body>
</html>
7 changes: 7 additions & 0 deletions examples/Zitadel.AspNet.AuthN/Pages/LoggedOut.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using System.Diagnostics;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace Zitadel.AspNet.AuthN.Pages;

public class LoggedOutModel : PageModel { }
1 change: 1 addition & 0 deletions examples/Zitadel.AspNet.AuthN/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
o.Authority = "https://zitadel-libraries-l8boqa.zitadel.cloud/";
o.ClientId = "170088295403946241@library";
o.SignInScheme = IdentityConstants.ExternalScheme;
o.SaveTokens = true;
})
.AddExternalCookie()
.Configure(
Expand Down

0 comments on commit 9266a1f

Please sign in to comment.