logo

Warning: The forum is now for consultation only. Please use GitHub Discussions to post any questions or comments.


Welcome Guest ! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
epf  
#1 Posted : Friday, February 13, 2015 6:21:39 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
The 1.6 version comes with a new security layer you can use to publish your reports on the Web...

All is can be done from the Configuration menu of the Server Manager application.

First you have to publish your Web Site on IIS by using the menu Configuration->Publish Web Site on IIS...
Check that your site is working by running some reports.

Then comes the security configuration you can handle with the menu Configuration->Configure Web Security

Then you have to define security groups:
A group is simply a list of sub-folders of the Repository Reports main folder.
A user belonging to the group will have access to the reports contained in the group sub-folders.

Finally you have to define how the user will be authenticated by the Web Server.
This is done by the choice of the security provider.

Depending on the security provider, a user name and password may be prompted, then the goal of the provider is to define the group the user belongs to.

Parameters dedicated to the provider can be set (e.g. the LDAP Server name for the LDAP Authentication)
Check the description of each parameter.

If necessary, the security script executed to authenticate the user and his group can be overwritten.
A short description may be available in each script (activated by the property Use custom security script).

Here are the providers available so far:
  • No Security
  • LDAP Authentication: Prompt a user/password, authenticate it with the LDAP Server, the security script may be modified to fetch the group in the database.
  • Integrated Windows Authentication: Use the integrated authentication , then try to match a security group with a windows group.
  • Database Authentication: Prompt a user/password, authenticate it with the database server, the security script may be modified to fetch the group in the database.
  • Basic Windows Authentication: Prompt a user/password, authenticate it with Windows, then try to match a security group with a windows group.
  • Basic Authentication: Prompt a user/password, security script may be modified to check the password and define the group


Note that all the security and the providers are defined in the Security sub-folder of your Repository. It could be easy to add a provider...

Edited by user Friday, February 13, 2015 6:25:00 PM(UTC)  | Reason: Not specified

shconley  
#2 Posted : Monday, February 23, 2015 7:02:38 PM(UTC)
shconley

Rank: Newbie

Groups: Registered
Joined: 2/20/2015(UTC)
Posts: 1
United States
Location: Coos Bay

Thank you so much for all the work you've put into this product! I am in the process of setting it all up and can't wait to start tapping into it's potential.

I've setup several reports, and they all work well. I am now trying to configure Database Authentication, and can't seem to get it working.
I am trying to connect to a MS SQL 2008r2 server, and query a table I have setup that contains the usernames, pwds and group names.
I am having difficulty setting up my Connection String as well as trying to get my query to handle multiple results.

Do you have an example script I could reference?

Thanks again for all you've done!
epf  
#3 Posted : Tuesday, February 24, 2015 8:59:09 AM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Hi, I think you should adapt the sample provided for the Database Authentication Security Provider.
Run the Server Manager application, then Configuration->Configure Web Security...
then select the Security Provider to Database Authentication.
then set Use Custom Script to true, and edit the script.
Remove all the lines except he ones below:

Code:
   
 //OR may come from Northwind: e.g. group=city coming from the employee table
    //Note that we can also use the user name and password to connect to the database
	//User=Fuller,Password=Andrew will return group Tacoma 
	string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + user.Security.Repository.RepositoryPath + "\\Databases\\Northwind.mdb;Persist Security Info=False";
	OleDbConnection connection = new OleDbConnection(connectionString);
	connection.Open();
	OleDbCommand command = new OleDbCommand(string.Format("select city from Employees where lastname={0} and firstname={1}", 	Helper.QuoteSingle(user.WebUserName), Helper.QuoteSingle(user.WebPassword)), connection);
	object group = command.ExecuteScalar();
	if (group != null && group != DBNull.Value)
	{
        user.AddSecurityGroup((string)group);	
    }
	else 
	{
		user.Error = "User unknown from the database.";
	}


From this sample, you should adjust your connection string to connect to your database.
Then adjust the SQL Select to return a group name. In this case the select must return one line. If nothing is found the user is considered as not authenticated but you could do the logic you want.

If it is not clear, try first to make it work on Northwind...

I hope it helps.
Cyrus10  
#4 Posted : Thursday, September 8, 2016 2:09:19 AM(UTC)
Cyrus10

Rank: Newbie

Groups: Registered
Joined: 9/8/2016(UTC)
Posts: 1
United States
Location: Tulsa

I have a question that how to write the code if the information for user login have already saved in mysql database. Could you show me an examle? Thx!
epf  
#5 Posted : Thursday, September 8, 2016 12:29:24 PM(UTC)
epf

Rank: Administration

Groups: Administrators
Joined: 12/20/2013(UTC)
Posts: 1,209
Switzerland

Thanks: 14 times
Was thanked: 206 time(s) in 199 post(s)
Based on the previous example,
just change your connection string to access your MySQL database (you need probably to install a driver first),
then adapt the SQL statement to query your database...
hqy  
#6 Posted : Friday, September 9, 2016 10:35:37 AM(UTC)
hqy

Rank: Newbie

Groups: Registered
Joined: 8/30/2016(UTC)
Posts: 1
China
Location: Asia

**************************
Error:
Unable to compile template. The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)

Other compilation errors may have occurred. Check the Errors property for more information.
********************************
Users browsing this topic
Guest (9)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.