• Login
  • Register

DNN Forums

A community discussion page. We're starting from scratch, so...let's get the party started!

DNN 9 login to default login page programmatically

You are not authorized to post a reply.
Sort:


New Member


Posts:4
New Member

    I create my dnn website and it contains 3 other sites

    I have another project where I'm using to login my user and then redirect to respective dnn site 

    code I'm using is 
    var user = DotNetNuke.Entities.Users.UserController.GetUserByName(portalId, userName); DotNetNuke.Entities.Users.UserController.UserLogin(portalId, user, portalName, IP, CreatePersistentCookie); this.Response.Redirect("https://mydnnsite.me");  //this site is my third site on same website with portalID 3

    after it redirects to my site,I'm still seeing the login button but when I checked the admin logs I can see it says LOGIN SUCCESS

    Whats am I doing wrong here 



    Basic Member


    Posts:76
    Basic Member

      Mohit, each website portal has its own set of users and so has a separate login. You are seeing that they logged in successfully on portal 3 (their entry point) and then when they get redirected to another portal, the destination portal requires an independent login. So they have to login there also. There are a number of strategies for Single-Sign On, and I don't know them all. But let me give you a few options that I do know.
      First, do they really need to log into portal 3? Can you redirect them to the right portal without logging them in? If so, then they only need to login once and that would be on the destination portal.
      Second, there are modules that will give you the ability to create a link that will log a user in automatically when they use the link. That could be great, or it could also be a security risk depending on your situation. I think another module fixes things for Single Sign On so if you log into one portal, you are automatically logged into another. Do a search in the DNN Store for login modules to see what is offered.


      New Member


      Posts:4
      New Member

        Hi Mark, 

        Thanks for the reply. Here I'm logging the user, say in portal 3, and redirecting the user to the same portal, not another portal. 
        I have a registration page in another project where the user register and then the login page is called which is in my DNN site to log in  the user via code automatically so when the user is redirected to the portal site he is already logged in. 



        New Member


        Posts:4
        New Member

          I think I solved the issue, I was calling the login page by using my portal subdomain (https://portal1.mysite.me/loginPage.aspx) and when I called using the page with subdomain same as the portal 3 (https://portal3.mysite.me/loginPage.aspx) it worked.

          Thanks Mark your reply really helped me.

          You are not authorized to post a reply.

          These Forums are dedicated to discussion of DNN Platform.

          For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

          1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
          2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
          3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
          4. No Flaming or Trolling.
          5. No Profanity, Racism, or Prejudice.
          6. Site Moderators have the final word on approving / removing a thread or post or comment.
          7. English language posting only, please.

          Would you like to help us?

          Awesome! Simply post in the forums using the link below and we'll get you started.

          Get Involved