Skip to content

Commit

Permalink
Set 'Logout Timeout' to 12 hours in web hook handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sk-keeper committed Mar 6, 2021
1 parent 1ebf792 commit 3cb8bae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions AzureAdminAutoApprove/AutoApprove.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ namespace AzureAdminAutoApprove
{
public static class AutoApprove
{

[FunctionName("KeeperConnectionGuard")]
public static async Task KeeperConnectionGuard(
[TimerTrigger("12 12 */12 * * *")]
[TimerTrigger("30 10 0/6 * * *")]
TimerInfo myTimer,
ILogger log)
{
Expand Down Expand Up @@ -78,6 +77,13 @@ public static async Task<IActionResult> ApprovePendingRequestsByWebHook(
log.LogWarning(message);
}

var timeout = auth.AuthContext.Settings.LogoutTimerInSec ?? TimeSpan.FromMinutes(30).TotalSeconds;
if (timeout <= TimeSpan.FromHours(6).TotalSeconds)
{
await auth.SetSessionInactivityTimeout((int) TimeSpan.FromHours(12).TotalMinutes);
log.LogInformation("Logout timeout is set to 12 hours");
}

return new OkResult();
}

Expand Down

0 comments on commit 3cb8bae

Please sign in to comment.