Mark B
Mark B

Reputation: 1186

Update DotNetNuke user from another web application

DNN Ver 5.6.7 .NET 3.5

Anyone know of a way to access/update user accounts on a DNN site from another web application?

My goal is to allow customer service to update an employee's DNN password from an intranet app (that includes some other employee related, non-DNN data), but I'm not having any luck. I tried adding a simple web service to a virtual directory (as described here) to the DNN site, hoping the web service would then have access to all things DNN, but I'm not able to create instances of the UserInfoController - it's not instantiating the MemberProvider object.

UserController objUserController = new UserController();
UserInfo objUser = objUserController.GetUser(portalId, userId);

Each time, the objUserController object shows null for DotNetNuke.Security.Membership.MembershipProvider

Both the DNN site and our internal web app are hosted on the same server. Any suggestions are appreciated.

EDIT: In addition to all the DLLs in the DNN bin folder, I also copied everything from the DNN web.config into my web service web.config that looked DNN related

Upvotes: 0

Views: 667

Answers (3)

Greg Griffin
Greg Griffin

Reputation: 1

I did this via http://iweb.adefwebserver.com/.

I added a web service method that took advantage of all the user related features in the DNN API (UserInfo, UserController, RoleController, etc.).

Upvotes: 0

Ehsan
Ehsan

Reputation: 845

if your WebService is inside DNN, this code must work:

UserInfo objUser = UserController.GetUserById(DotNetNuke.Entities.Portals.PortalSettings.Current.PortalId, userId);

Upvotes: 4

Bruce Chapman
Bruce Chapman

Reputation: 1247

If your intranet app is running on ActiveDirectory, I would look at some of the available ActiveDirectory integration modules.

If you can wait until DotNetNuke 6.2 comes out, it will include a built-in services layer which will allow you to authenticate and interact with DotNetNuke objects like users.

Upvotes: 0

Related Questions