Maybe an injection token is needed?
Just making sure case doesn't get closed for inactivity
Mahmut,
Any update on this?
hi,
I just want to make sure I understand what you said above. Are you saying that if our solution was an MVC/Blazor solution, this wouldn't be a problem? The slide would exist?
IE, because we are using an angular and .netcore solution, we do not get the slide.
maliming,
Part of the reason we adjusted the lifetimes above was to make it easier to test. I have some of the code changes locally as I'm developing. I have the scope removed, but not the lifetime adjustments.
It appears that when we just remove the offline_access, we will get logged out after ~1 hour. Meaning even if you're in the middle of something, you get brought back to the screen where you need to enter your credentials. So the time does not "slide". Is there a way to "slide" (meaning while the user is active, they stay logged in, but when they go idle for 1 hour, they get logged out)?
Create new angular website using suite/cli.
Is there a way without custom code of getting logged out after closing the browser tab/browser? We do use an npm package called angular idle that looks for inactivity on the website and then will log you out. But if just you close the tab/browser you are still logged in and can come back the future without credentials.
We have tried using window.unload and removing cookies in localStorage. This appears to work, but there are some situations in which you will be prevented from logging in. using the auth service to logout does not work. probably becuae it is an async process and does not make the tab/browser wait before closing We have tried adding middleware to set lifetimes, that doesn't work
PreConfigure<OpenIddictServerBuilder>(builder =>
{
builder.SetAuthorizationCodeLifetime(TimeSpan.FromMinutes(1));
builder.SetAccessTokenLifetime(TimeSpan.FromMinutes(1));
builder.SetIdentityTokenLifetime(TimeSpan.FromMinutes(1));
builder.SetRefreshTokenLifetime(TimeSpan.FromDays(1));
});
We could write an angular interceptor and use o-auth service to invalidate the token. This will not work for mvc sites
Ultimately, we want something on the backend which will force a logout if the user has been idle for a period of time. We can see there is are cookies in localStorage: id_token_expires_at expiresAt with expiration times
We understand that the refresh token plays a role in this, but that we want a hard lifetime when it would not play a role.
Mahmut, Maybe this will help Here's a brand new 7.1 abp site with angular (this is the latest, our current app is a version behind, but the problem still exists), no mobile and added stubbed file for alerts. Unfortunately, I did not do a git init before adding alerts. The changes are:
Mahmut,
Thanks for the quick reply. Here's more info on my issue. This is my customized template that I have (below). I have already commented out the code you described. I want what is there before login Home, Settings, Red button, EMPTY, Alerts and then after login I want Admin to be on the toolbar. Home, Settings, Red button, Admin, Alerts
The problem that is after login, my custom code is not executed (there are breakpoints in the ngOnInit, before login the breakpoints are hit). The original mobile nav bar code is. If I click the big red button, you can see the breakpoints being hit and then the mobile navbar displays as I want
<div class="lpx-mobile-navbar-container">
<div class="lpx-mobile-navbar">
<ul class="lpx-mobile-nav-tabs">
<!-- <li class="lpx-mobile-nav-tab"
*ngFor="let tab of navTabs"
[routerLink]="tab.link"
[routerLinkActive]="tab.link ? 'selected' : ''"
[routerLinkActiveOptions]="{ exact: tab.link === '/' }"
[class.selected]="tab.expanded">
<a class="lpx-mobile-nav-item">
<lpx-icon class="menu-item-icon"
*ngIf="tab.icon"
[iconClass]="tab.icon"></lpx-icon>
<span class="mobile-item-text">
{{ tab.mobileMenuText || tab.text | toObservable | async }}
</span>
</a>
</li> -->
<li class="lpx-mobile-nav-tab"
(click)="toggleMenu('settings', settingsMenuItems)"
[class.selected]="activeMenu === 'settings'">
<a class="lpx-mobile-nav-item">
<lpx-icon class="menu-item-icon"
iconClass="fas fa-home"></lpx-icon>
<span class="mobile-item-text">
{{ "Home" | lpxTranslate | async }}
</span>
</a>
</li>
<li class="lpx-mobile-nav-tab"
(click)="toggleMenu('settings', settingsMenuItems)"
[class.selected]="activeMenu === 'settings'">
<a class="lpx-mobile-nav-item">
<lpx-icon class="menu-item-icon"
iconClass="gearConnected"></lpx-icon>
<!-- TODO: PROVIDE API -->
<span class="mobile-item-text">{{
settingsTitle | lpxTranslate | async
}}</span>
</a>
</li>
<li class="lpx-mobile-nav-tab menu-toggle">
<a class="lpx-mobile-hamburger"
[ngClass]="toggleClass"
(click)="toggleNavbarMenu()">
<span class="hamburger-icon"
aria-hidden="true"
[class.lpx-mobile-menu-opn]="activeMenu === 'navbar'">
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
</span>
</a>
</li>
<li class="lpx-mobile-nav-tab"
(click)="profileMenuItems && toggleMenu('profile', profileMenuItems)"
[class.selected]="activeMenu === 'profile'">
<a class="lpx-mobile-nav-item">
<lpx-avatar [avatar]="userProfile.avatar"></lpx-avatar>
<span class="mobile-item-text">{{ userProfile.userName }}</span>
</a>
</li>
<li class="lpx-mobile-nav-tab"
(click)="profileMenuItems">
<a class="lpx-mobile-nav-item otised-alerts">
<otised-notification-icon />
<div class="mobile-item-text">{{
'Alerts' | lpxTranslate | async
}}</div>
</a>
</li>
</ul>
</div>
<div class="lpx-mobile-menu"
[hidden]="!menuVisible">
<div class="lpx-logo-container"><lpx-brand-logo></lpx-brand-logo></div>
<lpx-navbar-routes [navbarItems]="selectedMenuItems"
(routeClick)="closeMenu()">
</lpx-navbar-routes>
</div>
</div>
I cloned the lepton-x pro code. I copied the mobile-navbar files to my local project. I customized the html to look like I wanted. I added Alerts I added the component to the replacableComponents It looks good except before I login. i can browser refresh, Alerts icon still shows When I login in my breakpoints are not hit in the component and the default mobile nav shows If I click the big red button, my custom code breakpoints are hit. The Alerts icon shows properly If I browser refresh, the default mobile nav shows, my breakpoints are not hit
Not sure what else I need to add to the code. I have not added an injection tokens. Cannot find any documentation to tell me what I did wrong. I am using the latest lepton-x "@volosoft/abp.ng.theme.lepton-x": "^2.1.0",
Websites created with ABP 7.0.1 have a favicon that is a svg instead of an ico on the login page. On the "Welcome Page", an ico is used. Besides replacing the page (if possible), are there any options for using the favicon ico's that we already have? I tried some online conversions, to convert ico's to svg's and the result is ugly.