Usersource from username | Dynamic user source

Hi everyone,

I am working on a project that covers a number of plants.

I wanted to if there is a scripting function to know the user source from the user name. This will save me a lot of time in creating several projects for several plants.

I want to set the dynamic the user source and then open the project from a particular plant only.

Thanks,
Jatin

Hello Jatin,

Some more description would help address your inquiry here. What User Source do you want to dynamically change?

The scripting functions that interact with User Sources expect the user source to be provided. The functions do not work in the other direction, so we cannot extract a User Source from a Username.

Each Project on an Ignition Gateway has a default User Source and Identity Provider (IdP). These are static project properties and are not designed to be dynamic. When a user logs in, those credentials will be compared against the default User Source/IdP for the project.

“the functions do not work in the other direction, so we cannot extract a User Source from a Username.” - GOTCHA!

We have multiple plants with a different usersource for each plant. We have a launcher project which is tied to one plant only. I wanted to know if we can configure different plants with individual user sources tied to them in one launcher project alone. Rightnow, I configure individual launcher project for a particular plant.

I am unsure what this means, specifically I am not sure what you mean by “launcher project”:

We have multiple plants with a different usersource for each plant. We have a launcher project which is tied to one plant only.

I think you are implying that you have many plants that utilize the same base project, and the only notable difference between the projects would be the user sources for each. So you are having to currently setup a new project in the launcher for each plant and then update the user source to be correct. There is not a built-in way to make that project property more dynamic and each unique user source/plant will need its own project.

If I misunderstood your situation let me know.