I'm working on building a new section for Umbraco that uses an external API. The external API needs that user to store their username and password for each individual user. Please do not confuse this with membership. I know you can add additional fields there, but that is not what I'm asking. It's extremely important that I figure this out. Is there a way to possibly just extend the Umbraco user class?
Since I didn't get a reply, I will let you know my solution. I built this in order to be able to add usernames and passwords for an API which I am using for a new section in the backend. I ended up building a petapoco model that gets created into the database.
My model:
[TableName("MyApiUsers")]
[PrimaryKey("Id", autoIncrement = true)]
[ExplicitColumns]
public class MyApiUser
{
[Column("Id")]
[PrimaryKeyColumn(AutoIncrement = true)]
public int Id { get; set; }
//umbraco user id
[Column("UserId")]
public string UserId { get; set; }
[Column("UserName")]
public string UserName { get; set; }
//to be hashed later
[Column("Password")]
public string Password { get; set; }
}
Global.asax
public class MvcApplication : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
var db = applicationContext.DatabaseContext.Database;
if (!db.TableExist("MyApiUsers"))
{
db.CreateTable<MyApiUser>(false);
}
}
}
This allowed me to link my users to an api username and password. Hope this helps anyone looking.
Thanks very helpful.
Need something like this. I am developing a custom section and need to enforce authorization rules to different features within the custom section application.
I further need the Umbraco administrator have the ability to manage these authorization rules. Much like the being able to control the permissions from the "User Permissions".
Create backend users with Additional User Fields
I'm working on building a new section for Umbraco that uses an external API. The external API needs that user to store their username and password for each individual user. Please do not confuse this with membership. I know you can add additional fields there, but that is not what I'm asking. It's extremely important that I figure this out. Is there a way to possibly just extend the Umbraco user class?
Since I didn't get a reply, I will let you know my solution. I built this in order to be able to add usernames and passwords for an API which I am using for a new section in the backend. I ended up building a petapoco model that gets created into the database.
My model:
Global.asax
This allowed me to link my users to an api username and password. Hope this helps anyone looking.
Thanks very helpful. Need something like this. I am developing a custom section and need to enforce authorization rules to different features within the custom section application. I further need the Umbraco administrator have the ability to manage these authorization rules. Much like the being able to control the permissions from the "User Permissions".
Any thoughts?
Thanks, Krishna
is working on a reply...