I have created a service to get user email. When I run a service I get user email. But, I want to authenticate user using API and for that user retrieve email , then how to do that?
This is the code I have written to get email
[AllowAnonymous]
[HttpGet]
public HttpResponseMessage GetEmail(string username)
{
DotNetNuke.Entities.Users.UserInfo ui;
ui = DotNetNuke.Entities.Users.UserController.GetUserByName(username);
return Request.CreateResponse(HttpStatusCode.OK, ui.Email);
}
Help !
Example would be helpful