Note that there are some explanatory texts on larger screens.

plurals
  1. POasp.net authorization for many different folders
    primarykey
    data
    text
    <p>I am using asp.net (c#).</p> <p><strong>Problem:</strong></p> <p>I need to allow users to login from different pages:</p> <pre><code>www.mypage.com/login.aspx www.mypage.com/orgs/org-1/login.aspx www.mypage.com/orgs/org-2/login.aspx www.mypage.com/orgs/org-3/login.aspx </code></pre> <p>... where 1, 2, 3 etc. Organization IDs.</p> <p>Currently, when I open www.mypage.com/orgs/org-1/login.aspx user is redirected to www.mypage.com/login.aspx</p> <p><strong>Whole story:</strong> I have an application that was not coded by me. It has a main login page (www.mypage.com/login.aspx). But it has also many different login pages - every organization has its own login page that is located in folder Orgs/Org-ID/login.aspx. This is necessary because organizations wants to have different color schemes, logo, some extra information, custom welcome statements and other custom things on their login page. </p> <p>I was not working on it before, but the scheme now is following: 1) www.mypage.com/login.aspx is base login page; everyone can login from this page. It works. 2) there is a file OrgLogin.aspx (note that <strong>CodeBehind="Login.aspx.cs" !!!!</strong>) that contains some custom login page for organizations. It differs from Login.aspx a bit, but uses the same CodeBehind.</p> <p>3) When application administrator creates new organization from application interface, then OrgLogin.aspx file is copied to a location www.mypage.com/<strong>orgs/org-1/login.aspx</strong> (where 1 is organization id and it changes) and also renames this file to Login.aspx. Every login.aspx file then could be customized by the organization admins if they want to. If they do not want, then default page is used.</p> <p>So far it is clear, but the following is not working: 4) It is necessary to allow users to login from different pages: www.mypage.com/orgs/org-1/login.aspx -> displays login.aspx from appropriate folder (Login.aspx.cs from root folder is CodeBehind) www.mypage.com/orgs/org-2/login.aspx ... Currently, when I navigate to www.mypage.com/orgs/org-2/login.aspx system redirects user to www.mypage.com/login.aspx?returnurl....</p> <p><strong>EDIT</strong> The full structur of folder would be the following: orgs/org-<em>/login.aspx -> should be accessable without redirecting to root login orgs/org-</em>/forgotpassword.aspx -> should be accessable without redirecting to root forgotpassword orgs/org-<em>/document (folder) -> should not be accessable without authentication orgs/org-</em>/images (folder) -> should not be acessable without authentication</p> <p>I have read some sollutions when there are only two different folders and usually they are with different roles (admin and non-admin), for example, <a href="https://stackoverflow.com/questions/4012655/different-authentication-forms-for-different-folders">Different authentication forms for different folders</a>.</p> <p>But this is not my case.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload