how to configure different landing page for abp.io - abp

i am new in using abp.io . i am looking for a way to point as startup page. As per default it is using login page as startup page. I want it to point to a new landing page as startup page.

If you mean just a page inside your application, it depends if your application is just an api or MVC or a Razor Page application. But generally, redirecting to "LandingPage" from your Home Page/Controller action works.
If you mean an admin (back-office application) and a public application, you need to create a new application and register it as a client to identityserver.
You can check the microservice-demo sample that while BackendAdminApp.Host is an admin application, PublicWebSite.Host is a public application.

Related

How can I redirect unauthenticated Blazor Azure AD users to a different page than authenticated users?

I'm using the Blazor Server templates included with Visual Studio 2019.
In the template application that uses local authentication, When I view the page without being authenticated, the AuthorizeView tags work as expected, and the log in/out buttons on the navbar are displayed dynamically based on these tags. I am able to view the counter and weather forecast pages as a guest.
In the template application that uses Azure AD authentication, whenever I try and view a page without being authenticated, I'm redirected to the Microsoft login prompt. I'm still able to use the AuthorizeView tags to dynamically display components in the navbar, but what I want to be able to do is view the counter and weather forecast pages as a guest without getting redirected.
Is there any way to achieve this? Am I maybe missing something in App.razor?
Edit:
If I log out using the navbar link, and then navigate back with my browser, I can view the pages without authorization. But then when I refresh the page, I get sent back to https://login.microsoftonline.com/. What could be causing this? I want to view an unauthorized home page without getting redirected.
The behaviour you see is by design.
To change it you can make this change inside Startup.Configure :
services.AddControllersWithViews(options =>
{
var policy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.Build();
//options.Filters.Add(new AuthorizeFilter(policy));
});
(and of course reduce this code to just services.AddControllersWithViews(); when you want to keep it this way.)
With this change you will have to block private pages with #attribute [Authorize] or with <AuthorizeView> and there is no automatic redirect to the login page.

Spring MVC AngularJS Page Refresh/Redirect

I am using angularjs with spring mvc in my application. It is a single page application where there is a login button and multiple tabs. Tabs are not visible unless the user logs in. After user logs in, the tabs will be visible (login button will not be visible) and user can navigate and use features under any tab. The URL of all these actions will be same (Ex: www.xyz.com/context/).
I have problem with session management here. If the session expires when the user is in any of these tabs, say tab no. 3, the page should be reset to initial state where login button is visible and tabs are not.
I have configured spring session management like below
<security:session-management invalid-session-url="/invalidSession">
<security:concurrency-control expired-url="/" />
</security:session-management>
On session expiry, I have spring mvc controller configured to handle it. Like the one below.
#RequestMapping(value="/invalidSession", method = RequestMethod.GET)
public ModelAndView invalidSession () {
ModelAndView model = new ModelAndView("redirect:/");
model.setStatus(HttpStatus.);
return model;
}
Though this method is called on session expiry, the redirect doesn't reset my page to its initial state where only login button is visible. Rather, it stays in the same state in tab no. 3 and all other tabs still visible. If I hit the browser refresh button, it works fine.
I have also tried using model.setStatus(HttpStatus.RESET_CONTENT); in the above controller method, it still doesn't work.
I went through the question in Spring security and angular javascript redirect to login page, but it is bit complicated for my requirement and my requirement is quite simple. I guess we should be able to handle it through session management of spring with appropriate redirect where it resets my page.
How can I achieve this?
Ok. I have taken an angular approach. I have used component ng-idle as outlined in Angular session timeout and management.
Also, I have removed spring session-management tag as ng-idle solves my requirement.

Angular JS static site pages

I am wondering what is the best approach for achieving the following requirements. The site has about 5 static pages with a potential for many more in the future. Currently these pages are your typical web pages like home, about, company and so on. The site owner wants the login and signin forms to be modal window that animate in from the top. After authentication the user is redirected to the app which is an angular application.
Normally the signin/login form would be views in angular. I am wondering how to I use angular to deal with the forms while the home page is not actually part of the angular app.
Note the site owner whats the site to be on the same domain. So he doesn't want a static site that redirects to the app once the login/signin button is selected.
Thank you for any advice.

how to set visual force page as default in salesforce

I have a requirement that there is a user with particular profile and if he logs into the salesforce account, I want that he should be directly shifted to a visual force page. I tried to replace home tab with visual force page. But in profile this option is not editable. What I can do to accomplish this.
You could create a new "app". Apps are pretty much just sets of tabs (with exception of special stuff such as Service Cloud Console). In app you can define that there should be no home page, instead your visualforce (as a tab) would be added and marked as default landing page. Then you'd share this app with his profile and revoke access to other apps?
People can still add/remove tabs they wish to see in each app though so somebody might override your configuration.

Silverlight got http302 error after login successfully in iframe

I have one silverlight 4 application which contains one iframe to show aspx pages. The silverlight app and the application in iframe, both are hosted in the same web server.
First, there are two login.aspx pages. One is in silverlight app, other is in another site which is embedded in iframe. My silverlight app will be loaded first and login successfully for silverlight app.
Then, in my silverlight app, there is one link button to load the aspx page into iframe.
When I access the aspx page in the iframe at the first tim, it will go to its login.aspx and login successfully. After that, I go back to the silverlight app, i immediately get the http 302 error. But the duration between i access aspx page and the silvelight app, not bigger than the time of session timeout.
So could anyone be able to figure out what can make the error?
P.S. It only occures after aspx page logins successfully. If I do not touch the aspx pages in iframe, just acces the silverlight pages, it will have no error.
Today found the root cause and resolved it. It is due to the two applications are placed into same machine. Then, the second login will overwrote the authentication cookie of the first login. (It meant to call the sencond's FormsAuthentication.SetAuthCookie() will overwrite the first ones.) So the solution is very easy. Just to make their authentication cookie name different:
`
<authentication mode="Forms">
<forms name=".SecondAuthCookie" loginUrl="login.aspx"
defaultUrl="default.aspx" />
</authentication>
`

Resources