Create DNN user from console / windows application - dotnetnuke

My requirement might be very basic, but i'm new to DNN technology. google search doesn't help me.
I have millions of users in sql server with all details like password firstname, lastname, ....
I just want to move these users to DNN database. What is the best way for that ? It can be any stored procedure calling or I can write console application for that.
I created console application, but it is saying nullreference error, as it is a console application and unable to read site configuration, is there a way to manually set the configurations?
I am using latest version of DNN software and .NET 4.0. c#

aspx page option:
Create a new page in root of dnn that inherints from dotnetnuke.framework.pagebase and use this dnn wiki page to see how you can easily create user and add it to specific role.
Windows/console application option:
You can look at http://iweb.adefwebserver.com/ which is a windows application and consuming dnn api with some web services to get data from dnn. That will be a good starting point.

Related

Map asp.net core 2.0 Identity to existing DB schema

I have built a small web application with asp.net core 2.0 MVC. In this web application, I did not implement any authentication methods so far.
Right now I have an MSSQL database running in the background and I can add/view/edit/delete users from the database.
I adapted this tutorial and followed it pretty closely. However I also added some functionality like localization and stuff, and everything is running pretty smoothly.
My next goal is to enable authentication and authorization. The authentication part shall be straightforward. The goal is that the application will be running as an intranet solution. This means the authentication method just shall check if the Windows User is existing in the previously mentioned database. I don't want to create a separate login. However, it might be that there is a Windows user in the active directory, which is not part of the database. This User should just be able to see a default error page.
I made quite a huge research and I also tried a lot of different stuff, however, I do absolutely not find any "database first" tutorial for this part or any other documentation which explains what to do.
I actually "just" want to teach the asp.net core 2.0 identity framework that it shall look into my user-table and check if the current windows user is existent and if not to forward him to the error page.
A second step would be to load all the roles which this user is assigned to from the mapping table.
Any kind of help would be highly appreciated.
Dosc Microsoft has a lot of posts regarding authentication for ASP.NET Core. Here are some of the links to get you started:
ASP.NET Core Authentication
ASP.NET Core Authentication Identity
and a lot more.

Run the application from its EAR

I have only ear file of the application and I need to deploy it on the server. I tried deploying it directly on my integrated weblogic server but because of security in the EAR, it is asking username/password from me and when I provide one from jazn file of the application, it does not accept.
Next I tried creating customization application of the ear and there I gave reference to jazn file while creating project. Now it is accepting my password but while running, it is throwing error -
[oracle.jbo.NoDefException][oracle.jbo.mom.DefinitionManager.findDefinitionObject][ApplicationCustomer]
I googled this error but seems like it is because it is not able to find business components from the corresponding model project. I added the model project as a dependency but still getting the same error.
Any ideas ?
You can create your own users directly in Weblogic, though Weblogic Console:
http://docs.oracle.com/cd/E21764_01/apirefs.1111/e13952/taskhelp/security/DefineUsers.html
Since users are server specific and not application specific, you can use these users to log on against your application.
For convenience reasons an ADF application can deploy users and roles, but thats only for testing purposes. In Production systems, users are not being deployed with the application, but either created through Weblogic Console or Enterprise Manager, or 'injected' by a Authentication Provider.
Another option would be to change passwords for the users deployed along with the application. On Weblogic Console, go to:
Security Realms -> My realm -> User and Groups -> select one of the users -> Passwords.
Then provide New Password and Confirm New Password fields. Save.

Disabling website to everyone except portal administrators or host users in DotNetNuke 7?

Is it possible to disable a DNN portal, or an entire DNN installation to everyone except administrator / host users?
I need to update a DNN website and apply new themes to differant sections of the website, however this will take some time on the live website.
I'd like to achieve similar to this "Wordpress Maintenance Mode" module plugin.
I'm aware of using the APP_OFFLINE.html file to disable the entire website, however we need a couple of admins to go in and make changes whilst keeping everyone else off the website.
There isn't a maintenance mode in DNN. What I would do is the following.
Setup a new website in IIS, beta.mywebsite.com. Have that website point to your Existing DNN folder.
Point your current website to a new folder with the App_Offline.htm file/message in place. Then have your admins go to the beta.mywebsite.com URL instead of going to the www version of the URL.
That would probably be the most straightforward way to do this for DNN without writing a custom maintenance mode module for DNN.

Understanding DNN on existing website

I started working on an existing website that uses DNN. I am having difficulty understanding and accessing DNN in their staging/test environment. In IIS there are a few different websites. How can I figure out how to get to the main Admin DNN screen by looking at the information in IIS and exploring to files. Once there I need to apply new licenses for DNN.
Thanks in advance for any assistance.
In IIS, right click on the website and choose the Manage Bindings option, that will show you the various Host Names (URLS) that are configured.
Try those URLs, and then put ?CTL=login on the end of the URL to get DNN to load the login control. From there you can login with a HOST or ADMIN account, HOST/SuperUser account would be best, as you can then go to the Host/Portals (Site Management?) page and see how many different "sites" are configured within the DNN installation.

Accessing SP 2010 Object Model from Silverlight 4 Application

I have a Silverlight 4 Beta application where I'd like to use the SharePoint object model to upload a document to a SharePoint site - should be simple enough, except an exception is thrown at:
using (SPSite siteCollection = new SPSite(siteCollectionUrl))
The Web application at
http://intranet.fabrikam.com could not
be found. Verify that you have typed
the URL correctly. If the URL should
be serving existing content, the
system administrator may need to add a
new request URL mapping to the
intended application.
This particular exception is actually really well documented out there, it's obviously masking a real underlying issue. Here are some of the things I've read about and tried without success:
DNS / Host Header:
This exception occurs when the particular URL isn't in the IIS metabase because it's being handled by DNS. My web application has an AAM set up and a host header on the web site in IIS. I also tried running the code without using the FQDN of the site, e.g. http: //servername:4860.
Permissions:
The identity of the the Silverlight application pool has db_owner permissions to my content database, and is also a site collection administrator. I can't have both web sites use the same application pool because the Silverlight application needs to run in a .NET app pool.
x86 vs x64:
My Silverlight application has to be compiled for x86 - I'm using some controls that only work in x86. The installed SharePoint version is x64. I've read about people seeing this exception when trying to use the SharePoint object model to hit a x64 SharePoint installation from a x86 app.
Adding then removing permissions for the account: This begins to border on some voodoo magic, but I read about people magically resolving this issue after removing the permissions they set trying to troubleshoot this problem initially. No luck here.
Would appreciate any suggestions, thank you!
Silverlight runs on the client/browser, not on the server - so the server-side SharePoint object model will not be available to you.
However, there is an object model for SharePoint 2010/Silverlight apps - see this MSDN article for details.
To fix the particular error you mentioned, use "List", instead of "SPList". The Silverlight SharePoint object model is a little different from the basic non-Silverlight SharePoint object model.

Resources