DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

DNN Authentication and displaying other non-ASP.net content

Sort:
You are not authorized to post a reply.





Growing Member





    I have a DNN site and want to continue to use the login username/password and authentication system provided by DNN.

    However, I also have a Node.js/Express web application and am looking at a React application to show to on specific pages for specific user types / permissions.

    What is the best way to accomplish this?
    What if the apps are in subdomains? Like app.company.com ?
    The node.js application will interact with a MongoDB database similar to this question: https://stackoverflow.com...n-express-middleware

     






    New Around Here





      If I understand correct you want inject React app into the DNN page. And this React app should read DNN context, and in particular who is logged in and what permissions has that user. I'm right ?





      Growing Member





        Yes, exactly.  Is this possible?
        The DNN permission and authentication system is nice and already established.  
        Now I want to be able to serve a React web app to authenticated users with permission.  The app pulls data from a separate database.






        New Around Here





          The simplest way is to create standard DNN module (plugin) that will have React code inside it. This will give full access to the DNN context for the JavaScript (in your case React library) that is inside that module. The React code can call server side DNN method, that can be decorated by:
          [DnnModuleAuthorize(AccessLevel = SecurityAccessLevel.Anonymous)]
          [AllowAnonymous]
          [HttpGet]
          etc...


          There are downsides of that solution, because if you already have React apps that lives outside of the DNN environment. They must be rewritten and implemented into DNN module.
           






          Growing Member





            correct - I already have a react app and my developer doesn't know anything about Dotnetnuke. 
            I also don't know enough about module development to suggest rewriting it as a module...

            Are there other solutions?






            New Around Here





              You can save DNN info into the cookie, for example in format "user={userID}&dnnPortal={portalID}". Then React app can read that cookie. The biggest drawback can be security in this case. And this will work if both apps (DNN and React) are in the same domain.
              More complicated and secured approach is to use protocols like OAuth 2.0 and OpenID Connect.






              Growing Member





                Thanks -- are there DNN developers available to hire for the more secure authentication approach?

                How much would such an approach be expected to cost?

                This is above my head and i don't know how complicated it is!

                You are not authorized to post a reply.

                These Forums are dedicated to the 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. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
                2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
                3. 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.
                4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
                5. No Flaming or Trolling.
                6. No Profanity, Racism, or Prejudice.
                7. Site Moderators have the final word on approving / removing a thread or post or comment.
                8. 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