Showing posts with label extension. Show all posts
Showing posts with label extension. Show all posts

Tuesday, March 27, 2012

Customized Delivery Extension

I am developing a customized delivery extension and I am trying to
write the stream renderedoutputfile[] to a file on the server. When I
write it to a file, the file is blank with a bunch of spaces in it. Do
I need to decode the Stream? Any help would be great.
Here is the code I am using.
This is inside the Delivery Method..
deviceInfo = String.Format(@."<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>","PDF");
// Render report
files = notification.Report.Render("PDF",deviceInfo);
BinaryReader br = new BinaryReader(m_files[0].Data);
byte[] byteData = new byte[(int)m_files[0].Data.Length];
int j = br.Read(byteData,0, (int)m_files[0].Data.Length);
FileStream fst = new FileStream(@."c:\temp\test.pdf", FileMode.Append,
FileAccess.Write);
BinaryWriter writer = new BinaryWriter(fst);
writer.Write(byteData,0,byteData.Length);
writer.Flush();
writer.Close();
What I am doing wrong? Code is in c#.Is it as simple as:
files = notification.Report.Render("PDF",deviceInfo);
=> note you're writing to local variable files
BinaryReader br = new BinaryReader(m_files[0].Data);
=> note you're reading from member variable m_files
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"jason" <obryan7@.hotmail.com> wrote in message
news:d16403e7.0407180926.620e1a79@.posting.google.com...
> I am developing a customized delivery extension and I am trying to
> write the stream renderedoutputfile[] to a file on the server. When I
> write it to a file, the file is blank with a bunch of spaces in it. Do
> I need to decode the Stream? Any help would be great.
> Here is the code I am using.
> This is inside the Delivery Method..
> deviceInfo =String.Format(@."<DeviceInfo><OutputFormat>{0}</OutputFormat></DeviceInfo>","
PDF");
> // Render report
> files = notification.Report.Render("PDF",deviceInfo);
> BinaryReader br = new BinaryReader(m_files[0].Data);
> byte[] byteData = new byte[(int)m_files[0].Data.Length];
> int j = br.Read(byteData,0, (int)m_files[0].Data.Length);
> FileStream fst = new FileStream(@."c:\temp\test.pdf", FileMode.Append,
> FileAccess.Write);
> BinaryWriter writer = new BinaryWriter(fst);
> writer.Write(byteData,0,byteData.Length);
> writer.Flush();
> writer.Close();
> What I am doing wrong? Code is in c#.

Tuesday, March 20, 2012

Custom Source extension & file permissions

I programmed a Source extension, that accesss a text file. In my code I have the following code to open a file:

protected override void reader(PipelineBuffer buffer)

{

TextReader reader = File.OpenText(_filename);

The komponnet works well. How do I grant permissions to access this text file? Because I got problems when I try to run my package using a task created in the SQL Server Agent.

This sounds like a how do I use windows file security question, not a SSIS issue at all. Simple, use Windows Explorer, and select the drive, folder or file and right-click to access the security tab. Is that really what you are asking?

Have you determined the security context (account) used by SQL Agent? You will of course need to do this to grant that account with the correct permissions.

This also seems unrelated to the component used.

|||

I coudn't access the resources. I used the following \\server\share

And it works!

custom sercurity extention and ssl

can the custome security extension for forms authentication use ssl?yes, you can use forms authentication and ssl at the same the.
We are doing that, and, BTW, it is highly recommended in extranet
environment.
Oleg Yevteyev,
San Diego, CA
It is OK to contact me with a contracting opportunity.
"myfirstname"001atgmaildotcom.
Replace "myfirstname" with Oleg.
--
"Marvin" <Marvin@.discussions.microsoft.com> wrote in message
news:68F16E7C-D64B-4315-B1F4-A68532032AB5@.microsoft.com...
> can the custome security extension for forms authentication use ssl?

Custom Security: How do you manage groups

Dear Anyone,

We are trying to create our own custom security extension for rs2005. We are wondering how will then security extension will manage the authenticated users and how will it be mapped to an existing RS2005 group or role?

Thanks,

Joseph

It completely depends on how you write the extension itself.

I'd recommend that you use the forms auth extension as a start: C:\Program Files\Microsoft SQL Server\90\Samples\Reporting Services\Extension Samples\FormsAuthentication Sample

Change the parts of it that handle authentication, and then leave the parts alone which do authorization for you.

If you go this route, you will continue to use all the same roles you did before: Browser, Content Manager, etc.

|||

How would this dovetail with using Custom roles within the custom authentication database?

I've already implemented a version of the custom authentication extension and have the basic SSRS Forms auth working.

For example, users of my application log in with a companycode and would be put into one or many custom application roles that would ostensibly control the visibility of various folders and reports (you can imagine the various scenarios). Would I have to intercept the ASP.NET authentication pipeline and insert a custom Principal/Identity into the HTTP context? Would SSRS use the "User.IsInRole" construct to determine if the user is in a role that can "see" the restricted SSRS objects?

Just in case I confused anyone...I want to be able to add application-domain roles to the SSRS built-in (and possibly custom) roles and use those to restrict visibility to the SSRS objects.

Thanks,

Matthew Belk

|||Did you ever find an answer to this question? We're wanting to do the same thing (use roles from our custom application DB).|||

You can do this by assigning security within RS using the role names (just like windows groups). To get this to work though you will need to:

1. make your implementation of IAuthenticationExtension.IsValidPrincipalName check against the roles in your custom database
2. Implement IAuthorisationExtension.CheckAccess and in there look up the roles the user belongs to and check the access based on the username and his roles.

A good sample of this is located at:

http://www.devx.com/dotnet/Article/26759 - Part 1
http://www.devx.com/dotnet/Article/27133 - Part 2

Incidentally, I would like to take this further by using the Membership and Role Management Application Services of ASP.NET 2.0 to manage my users and roles.

So far I've been able to get the Forms Authentication working and I've set up the Membership and Role Management features, but when I try to use the 2 together i.e. make my logon.aspx page call Membership.ValidateUser the report server stops working and returns:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help

Object reference not set to an instance of an object.

Custom Security: How do you manage groups

Dear Anyone,

We are trying to create our own custom security extension for rs2005. We are wondering how will then security extension will manage the authenticated users and how will it be mapped to an existing RS2005 group or role?

Thanks,

Joseph

It completely depends on how you write the extension itself.

I'd recommend that you use the forms auth extension as a start: C:\Program Files\Microsoft SQL Server\90\Samples\Reporting Services\Extension Samples\FormsAuthentication Sample

Change the parts of it that handle authentication, and then leave the parts alone which do authorization for you.

If you go this route, you will continue to use all the same roles you did before: Browser, Content Manager, etc.

|||

How would this dovetail with using Custom roles within the custom authentication database?

I've already implemented a version of the custom authentication extension and have the basic SSRS Forms auth working.

For example, users of my application log in with a companycode and would be put into one or many custom application roles that would ostensibly control the visibility of various folders and reports (you can imagine the various scenarios). Would I have to intercept the ASP.NET authentication pipeline and insert a custom Principal/Identity into the HTTP context? Would SSRS use the "User.IsInRole" construct to determine if the user is in a role that can "see" the restricted SSRS objects?

Just in case I confused anyone...I want to be able to add application-domain roles to the SSRS built-in (and possibly custom) roles and use those to restrict visibility to the SSRS objects.

Thanks,

Matthew Belk

|||Did you ever find an answer to this question? We're wanting to do the same thing (use roles from our custom application DB).|||

You can do this by assigning security within RS using the role names (just like windows groups). To get this to work though you will need to:

1. make your implementation of IAuthenticationExtension.IsValidPrincipalName check against the roles in your custom database
2. Implement IAuthorisationExtension.CheckAccess and in there look up the roles the user belongs to and check the access based on the username and his roles.

A good sample of this is located at:

http://www.devx.com/dotnet/Article/26759 - Part 1
http://www.devx.com/dotnet/Article/27133 - Part 2

Incidentally, I would like to take this further by using the Membership and Role Management Application Services of ASP.NET 2.0 to manage my users and roles.

So far I've been able to get the Forms Authentication working and I've set up the Membership and Role Management features, but when I try to use the 2 together i.e. make my logon.aspx page call Membership.ValidateUser the report server stops working and returns:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help

Object reference not set to an instance of an object.sql

Custom Security: How do you manage groups

Dear Anyone,

We are trying to create our own custom security extension for rs2005. We are wondering how will then security extension will manage the authenticated users and how will it be mapped to an existing RS2005 group or role?

Thanks,

Joseph

It completely depends on how you write the extension itself.

I'd recommend that you use the forms auth extension as a start: C:\Program Files\Microsoft SQL Server\90\Samples\Reporting Services\Extension Samples\FormsAuthentication Sample

Change the parts of it that handle authentication, and then leave the parts alone which do authorization for you.

If you go this route, you will continue to use all the same roles you did before: Browser, Content Manager, etc.

|||

How would this dovetail with using Custom roles within the custom authentication database?

I've already implemented a version of the custom authentication extension and have the basic SSRS Forms auth working.

For example, users of my application log in with a companycode and would be put into one or many custom application roles that would ostensibly control the visibility of various folders and reports (you can imagine the various scenarios). Would I have to intercept the ASP.NET authentication pipeline and insert a custom Principal/Identity into the HTTP context? Would SSRS use the "User.IsInRole" construct to determine if the user is in a role that can "see" the restricted SSRS objects?

Just in case I confused anyone...I want to be able to add application-domain roles to the SSRS built-in (and possibly custom) roles and use those to restrict visibility to the SSRS objects.

Thanks,

Matthew Belk

|||Did you ever find an answer to this question? We're wanting to do the same thing (use roles from our custom application DB).|||

You can do this by assigning security within RS using the role names (just like windows groups). To get this to work though you will need to:

1. make your implementation of IAuthenticationExtension.IsValidPrincipalName check against the roles in your custom database
2. Implement IAuthorisationExtension.CheckAccess and in there look up the roles the user belongs to and check the access based on the username and his roles.

A good sample of this is located at:

http://www.devx.com/dotnet/Article/26759 - Part 1
http://www.devx.com/dotnet/Article/27133 - Part 2

Incidentally, I would like to take this further by using the Membership and Role Management Application Services of ASP.NET 2.0 to manage my users and roles.

So far I've been able to get the Forms Authentication working and I've set up the Membership and Role Management features, but when I try to use the 2 together i.e. make my logon.aspx page call Membership.ValidateUser the report server stops working and returns:

An internal error occurred on the report server. See the error log for more details. (rsInternalError) Get Online Help

Object reference not set to an instance of an object.

Custom Security w/ Standard Edition/

Hello...

I am trying to verify that the ability to use the security extension to use Forms based authentication is available (or not) with SQL 2005 Standard. I have read a few books and articles that state that only the Enterprise edition will allow us to use the security extensions to customize authentication and authorization. But a few recently have told me otherwise.

Does anyone know for sure? We use Standard edition...and would like to customize our security.

thanks

- will

Hello again,

Does anyone know the answer here?

Thanks for any help,

- will

|||

SQL Server 2005 Reporting Services Standard edition allows custom security :-)

http://msdn2.microsoft.com/en-us/library/ms143761.aspx

Features/Reporting Services Enhancements

EE (32-bit) DE (32-bit) EE (64-bit) DE (64-bit)

SE (32-bit) SE (64-bit)

WG (32-bit)

SSE (32-bit)

SSEA (32-bit)

Support for remote and nonrelational data sources

Yes

Yes

No

No

No

DHTML, Excel, PDF, and Image rendering extensions

Yes

Yes

Yes

No

Yes

MHTML, CSV, XML, and Null rendering extensions

Yes

Yes

No

No

No

E-mail and file share delivery extensions

Yes

Yes

No

No

No

Custom data processing, delivery, and rendering extensions

Yes

Yes

No

No

No

Custom authentication extensions

Yes

Yes

Yes

No

No

Custom Security Extensions for SQL RS 2005

Hi,

I'm having a lot of trouble trying to set up a custom security extension with Reporting Services 2005. Following the VB example from McGraw Hill Osborne (http://www.mhprofessional.com/product.php?cat=112&isbn=0072262397&cat=112), I've compiled the .dll for the extension and made the changes to the ReportManager and ReportServer .config files. After I reset IIS and return to the RS website, it displays "The report server has encountered a configuration error..." and I get a message in my System Event log:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID
{BA126AD1-2166-11D1-B1D0-00805FC1270E}
to the user MYMACHINE\ASPNET SID (S-1-5-21-1708537768-839522115-1343024091-1005). This security permission can be modified using the Component Services administrative tool.

Wondering if anyone else has had similar trouble and how did they get around it?

Have you modified the RSSrvPolicy.config ?

Here is a guide I followed to successfully implement custom authentication in RS.

http://msdn2.microsoft.com/en-us/library/ms160724.aspx

Look at the section "To modify the RSSrvPolicy.config file"

Regards Andreas|||

Here are the changes I made to .config files before running Reporting Services and getting these errors:

Under the ReportManager directory:

rsmgrpolicy.config - MyComputer code group permission from Execution to FullTrust

rsWebApplication.config - modified <UI> entry, added redirection to login page + URL

Web.config - identify impersonate -> "false"

Under the ReportServer dierctory:

RSReportServer.config - Added <Extension> elements with Name ="Forms" inside both <Security> and <Authentication>

rssvrpolicy.config - added new <CodeGroup> block just under CodeGroup with "$CodeGen$" string

web.config - identify impersonate -> "false"

sql

Custom security extension permission problem

I've created a Reporting Service security extension based on the sample. It works great on my development 2003 servers but when moved into integration environment I am getting the following error in Report Manager when clicking a report:

Could not load file or assembly 'Microsoft.ReportingServices.ProcessingObjectModel, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Access is denied.

Navigating folders and creating folders all seems to work in Report Manager. We only get this error when selecting a report. If I uninstall the custom security extension then everything works.

This seems like a difference in security settings between the two server but I'm not sure how to troubleshoot it.

Thanks

William

William

I had a similar problem and it was due to the fact that the user account of the SQL Server Reporting Services (MSSQLSERVER) service did not have access to the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files directory. It needs Modify access. Once I changed that, it worked fine.

Good luck

|||

Thanks.

I had to add modify permissions on C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files to the Execution Account I specified in Reporting Services Configuration Manager. This is because I ran a report with a local datasource (with dynamic connectionstring) with setting "Credentials are not required".

Pierre

Custom security extension permission problem

I've created a Reporting Service security extension based on the sample. It works great on my development 2003 servers but when moved into integration environment I am getting the following error in Report Manager when clicking a report:

Could not load file or assembly 'Microsoft.ReportingServices.ProcessingObjectModel, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Access is denied.

Navigating folders and creating folders all seems to work in Report Manager. We only get this error when selecting a report. If I uninstall the custom security extension then everything works.

This seems like a difference in security settings between the two server but I'm not sure how to troubleshoot it.

Thanks

William

William

I had a similar problem and it was due to the fact that the user account of the SQL Server Reporting Services (MSSQLSERVER) service did not have access to the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files directory. It needs Modify access. Once I changed that, it worked fine.

Good luck

|||

Thanks.

I had to add modify permissions on C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files to the Execution Account I specified in Reporting Services Configuration Manager. This is because I ran a report with a local datasource (with dynamic connectionstring) with setting "Credentials are not required".

Pierre

Custom security extension permission problem

I've created a Reporting Service security extension based on the sample. It works great on my development 2003 servers but when moved into integration environment I am getting the following error in Report Manager when clicking a report:

Could not load file or assembly 'Microsoft.ReportingServices.ProcessingObjectModel, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. Access is denied.

Navigating folders and creating folders all seems to work in Report Manager. We only get this error when selecting a report. If I uninstall the custom security extension then everything works.

This seems like a difference in security settings between the two server but I'm not sure how to troubleshoot it.

Thanks

William

William

I had a similar problem and it was due to the fact that the user account of the SQL Server Reporting Services (MSSQLSERVER) service did not have access to the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files directory. It needs Modify access. Once I changed that, it worked fine.

Good luck

|||

Thanks.

I had to add modify permissions on C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files to the Execution Account I specified in Reporting Services Configuration Manager. This is because I ran a report with a local datasource (with dynamic connectionstring) with setting "Credentials are not required".

Pierre

Custom Security Extension issue...

I have tried to write a custom security extension. When I run the report
manager I get ...
Object Reference is not set to an instance of an object.
It's breaking in GlobalApp.Application_AuthenticationRequest
I figure its because it can't find my extension but I have the correct Url
in the securityextensioncodegroup. Could it be the type attibute in the
extension tag?
Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"You may be getting the exception in the GetWebRequest override in the
derived ReportingService class because the HttpContext.Current.Request is
null which causes the call to the AuthCookie property to fail. I'm having a
similar problem that I'm working through right now. Maybe this will give you
some place to start looking for the problem.
Just a thought...
Garry
"Tad" <Tad@.discussions.microsoft.com> wrote in message
news:CF04B8C0-641A-4D50-9A90-B49625266D90@.microsoft.com...
> I have tried to write a custom security extension. When I run the report
> manager I get ...
> Object Reference is not set to an instance of an object.
> It's breaking in GlobalApp.Application_AuthenticationRequest
> I figure its because it can't find my extension but I have the correct Url
> in the securityextensioncodegroup. Could it be the type attibute in the
> extension tag?
> Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"|||Gary,
Have you found a solution to this issue of the
HttpContext.Current.Request being null or found more information on
what might cause this to be null?
- Jessica
Garry Lenz wrote:
> You may be getting the exception in the GetWebRequest override in the
> derived ReportingService class because the
HttpContext.Current.Request is
> null which causes the call to the AuthCookie property to fail. I'm
having a
> similar problem that I'm working through right now. Maybe this will
give you
> some place to start looking for the problem.
> Just a thought...
> Garry
>
> "Tad" <Tad@.discussions.microsoft.com> wrote in message
> news:CF04B8C0-641A-4D50-9A90-B49625266D90@.microsoft.com...
> > I have tried to write a custom security extension. When I run the
report
> > manager I get ...
> >
> > Object Reference is not set to an instance of an object.
> >
> > It's breaking in GlobalApp.Application_AuthenticationRequest
> >
> > I figure its because it can't find my extension but I have the
correct Url
> > in the securityextensioncodegroup. Could it be the type attibute
in the
> > extension tag?
> >
> > Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"|||This looks familiar. It could be one of a myriad of things. In our case,
the custom security extension called a web service, and there was an invalid
type definition in the web reference. We had to delete all our binaries and
web references from the development environment, reattach the web references
and recompile. Then it worked.
I hope that points you in the right direction. Bottom line issue: don't
lose your cookies.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
<Jessica.Landisman@.ndchealth.com> wrote in message
news:1105364285.978877.33130@.c13g2000cwb.googlegroups.com...
> Gary,
> Have you found a solution to this issue of the
> HttpContext.Current.Request being null or found more information on
> what might cause this to be null?
> - Jessica
> Garry Lenz wrote:
>> You may be getting the exception in the GetWebRequest override in the
>> derived ReportingService class because the
> HttpContext.Current.Request is
>> null which causes the call to the AuthCookie property to fail. I'm
> having a
>> similar problem that I'm working through right now. Maybe this will
> give you
>> some place to start looking for the problem.
>> Just a thought...
>> Garry
>>
>> "Tad" <Tad@.discussions.microsoft.com> wrote in message
>> news:CF04B8C0-641A-4D50-9A90-B49625266D90@.microsoft.com...
>> > I have tried to write a custom security extension. When I run the
> report
>> > manager I get ...
>> >
>> > Object Reference is not set to an instance of an object.
>> >
>> > It's breaking in GlobalApp.Application_AuthenticationRequest
>> >
>> > I figure its because it can't find my extension but I have the
> correct Url
>> > in the securityextensioncodegroup. Could it be the type attibute
> in the
>> > extension tag?
>> >
>> > Type="RSSecurity.AuthorizationExtension,AuthorizationExtension"
>sql

Custom Security Extension

Hi,

My company has an application in the standard client-server architecture; The client is written in VB 6 and uses reports from the old VB 6 report designer. I am currently undertaking a project which involves transferring these reports to Reporting Services in order to allow access via the internet (a new reporting web front-end is also being designed to work in tandem with the old client). The current client has data restriction features which restrict data and report access depending on a users group - these features can be managed via the client by users with the correct privileges. In order to prevent creation and maintenance of accounts on the both the Report Server and the database for the old client (and to allows non-windows authentication) I have implemented a custom security extension which authenticates users by checking their credentials against the client's database; I also need to authorize users requests against this database however I don't seem to be able to retrieve the identity of the catalogue item that Reporting Services is requesting authorization for.

for example a report is requested; Reporting Services calls the following method:

public bool CheckAccess(string userName, IntPtr userToken, byte[] secDesc, Microsoft.ReportingServices.Interfaces.ReportOperation requiredOperation)

I can't find a way of obtaining the reports name or identity from within this method so I can use it to query the external database to ascertain authorization.

Can anybody help? Am I missing something glaringly obvious?

Your time is very much appreciated.

Adam

I have the same problem.

In RS 2000 Version, I found this information at HttpContext.Request.QueryString[0]

But in 2005 I can't find it in HttpContext..... and I need it urgently.|||I have the solution. Call this Method from IAuthorizationExtension Constructor or from your CheckAccess Method:
<code>
public string GetReportName()
{
HttpContext.Current.Request.InputStream.Position = 0;

StreamReader rd = new StreamReader(HttpContext.Current.Request.InputStream);

XmlDocument SOAPDocument = new XmlDocument();

SOAPDocument.LoadXml(rd.ReadToEnd());

HttpContext.Current.Request.InputStream.Position = 0;

XmlNamespaceManager ns = new XmlNamespaceManager(SOAPDocument.NameTable);
ns.AddNamespace("def","http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices");
ns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");

XmlNode result = null;
result = SOAPDocument.SelectSingleNode("//def:Item",ns);

if (result == null)
{
result = SOAPDocument.SelectSingleNode("//def:Report",ns);
}
if (result == null)
{
return HttpContext.Current.Cache["ReportName"].ToString();
}

String ReportPath = result.InnerText;

string[] ReportDescription = ReportPath.Split(new char[] { '/' });

HttpContext.Current.Cache.Insert("ReportName",ReportDescription[ReportDescription.Length-1],null,DateTime.Now.AddMinutes(5),TimeSpan.Zero);

return ReportDescription[ReportDescription.Length - 1];
}
</code>|||I don't think this method will work reliably. Can you elaborate on why you need the path in the security extension - why isn't the ACL that's passed in enough to make access check decisions?|||The ACL passed in check decisions method, is based in roles configured in Report Manager.

The security of my client has his own roles. I need know de report name to ask to my client security framework which type of access has the user to this report name.

PD: Sorry for my bad english.|||

Tudor Trufinescu - MSFT wrote:

I don't think this method will work reliably. Can you elaborate on why you need the path in the security extension - why isn't the ACL that's passed in enough to make access check decisions?

I have posted exactly the same question. The ACL doesn't tell me anything about what the actual object is that the user is trying to get to. It would be helpful to know that User X is trying to execute Report Y in order to do custom authorization....

Custom Security Extension

Hi,

My company has an application in the standard client-server architecture; The client is written in VB 6 and uses reports from the old VB 6 report designer. I am currently undertaking a project which involves transferring these reports to Reporting Services in order to allow access via the internet (a new reporting web front-end is also being designed to work in tandem with the old client). The current client has data restriction features which restrict data and report access depending on a users group - these features can be managed via the client by users with the correct privileges. In order to prevent creation and maintenance of accounts on the both the Report Server and the database for the old client (and to allows non-windows authentication) I have implemented a custom security extension which authenticates users by checking their credentials against the client's database; I also need to authorize users requests against this database however I don't seem to be able to retrieve the identity of the catalogue item that Reporting Services is requesting authorization for.

for example a report is requested; Reporting Services calls the following method:

public bool CheckAccess(string userName, IntPtr userToken, byte[] secDesc, Microsoft.ReportingServices.Interfaces.ReportOperation requiredOperation)

I can't find a way of obtaining the reports name or identity from within this method so I can use it to query the external database to ascertain authorization.

Can anybody help? Am I missing something glaringly obvious?

Your time is very much appreciated.

Adam

I have the same problem.

In RS 2000 Version, I found this information at HttpContext.Request.QueryString[0]

But in 2005 I can't find it in HttpContext..... and I need it urgently.|||I have the solution. Call this Method from IAuthorizationExtension Constructor or from your CheckAccess Method:
<code>
public string GetReportName()
{
HttpContext.Current.Request.InputStream.Position = 0;

StreamReader rd = new StreamReader(HttpContext.Current.Request.InputStream);

XmlDocument SOAPDocument = new XmlDocument();

SOAPDocument.LoadXml(rd.ReadToEnd());

HttpContext.Current.Request.InputStream.Position = 0;

XmlNamespaceManager ns = new XmlNamespaceManager(SOAPDocument.NameTable);
ns.AddNamespace("def","http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices");
ns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");

XmlNode result = null;
result = SOAPDocument.SelectSingleNode("//def:Item",ns);

if (result == null)
{
result = SOAPDocument.SelectSingleNode("//def:Report",ns);
}
if (result == null)
{
return HttpContext.Current.Cache["ReportName"].ToString();
}

String ReportPath = result.InnerText;

string[] ReportDescription = ReportPath.Split(new char[] { '/' });

HttpContext.Current.Cache.Insert("ReportName",ReportDescription[ReportDescription.Length-1],null,DateTime.Now.AddMinutes(5),TimeSpan.Zero);

return ReportDescription[ReportDescription.Length - 1];
}
</code>|||I don't think this method will work reliably. Can you elaborate on why you need the path in the security extension - why isn't the ACL that's passed in enough to make access check decisions?|||The ACL passed in check decisions method, is based in roles configured in Report Manager.

The security of my client has his own roles. I need know de report name to ask to my client security framework which type of access has the user to this report name.

PD: Sorry for my bad english.|||

Tudor Trufinescu - MSFT wrote:

I don't think this method will work reliably. Can you elaborate on why you need the path in the security extension - why isn't the ACL that's passed in enough to make access check decisions?

I have posted exactly the same question. The ACL doesn't tell me anything about what the actual object is that the user is trying to get to. It would be helpful to know that User X is trying to execute Report Y in order to do custom authorization....|||I have tried using the suggestion in this thread. Unfortunately, it does not work. Report Server will make many calls to the CheckAccess methods to fill one user request. At some point one of those calls will throw an XML related exception using the GetReportName method. The exception will say "no root node". I don't want to handle this exception by catching it and returning true in the CheckAccess method. So I catch the exception and send back false. Just one false return value will cause the Report Server to send back a failed authorization message to the user if if all of the previous calls to CheckAccess returned true.

Any thoughts on a way to enhance this approach without compromising security?

custom security extension

Hi Everyone,
After implementing the custom security for Report server I am getting
this error when I try to login to the Reporting Services through SQL
Management Studio.
Error: Client found response content type of '', but expected
'text/xml'.
The request failed with an empty response.
Does anyone have any solution for this. Please let me know if you do.
Thanks in Advance,
BharathHi All,
I found the cause and resolution for this error. I thought of sharing
it here.
After implementing the forms authentication, you will have to login to
the Reporting services in the Management Studio using forms
authentication itself. Otherwise the user is likely to get the error
mentioned below.
Bharath
bharath.mp@.gmail.com wrote:
> Hi Everyone,
> After implementing the custom security for Report server I am getting
> this error when I try to login to the Reporting Services through SQL
> Management Studio.
> Error: Client found response content type of '', but expected
> 'text/xml'.
> The request failed with an empty response.
> Does anyone have any solution for this. Please let me know if you do.
> Thanks in Advance,
> Bharath

Monday, March 19, 2012

custom security extension

Hello,
i tried the sample for the custom security extension for sql server 2005.
the c# Version worked, the vb.net version does not!
Is there another example with the use of application roles? We need this for
reporting issues.
thx in advange
michaelHi michael,
Welcome to use MSDN Managed Newsgroup Support.
I am not so sure which sample application you can not deploy. Would you
please post the Application path here?
As for the samples of Application Role, you may try to refer SQL Server
books online.
An application role is a database principal that enables an application to
run with its own, user-like privileges.
The following steps make up the process by which an application role
switches security contexts:
A user executes a client application.
The client application connects to an instance of SQL Server as the
user.
The application then executes the sp_setapprole stored procedure with
a password known only to the application.
If the application role name and password are valid, the application
role is activated.
At this point the connection loses the permissions of the user and
assumes the permissions of the application role.
For more detail information, you may refer the following article:
Application Roles
http://msdn2.microsoft.com/en-us/library/ms190998(SQL.90).aspx
CREATE APPLICATION ROLE
http://msdn2.microsoft.com/en-us/library/ms181491(SQL.90).aspx
Hope this will be helpful.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Hello Wei,
I tried this sample application:
c:\Program Files\Microsoft SQL Server\90\Samples\Reporting
Services\Extension Samples\FormsAuthentication Sample\cs\FormsAuthentication
It worked for me, but i need the ability to work also with Roles (instead of
NT Group names).
Is there a sample application which consider application roles to group
users with identical permissions for a Custom security extension for sql
server 2005?
thx
michael
"Wei Lu" wrote:
> Hi michael,
> Welcome to use MSDN Managed Newsgroup Support.
> I am not so sure which sample application you can not deploy. Would you
> please post the Application path here?
> As for the samples of Application Role, you may try to refer SQL Server
> books online.
> An application role is a database principal that enables an application to
> run with its own, user-like privileges.
> The following steps make up the process by which an application role
> switches security contexts:
> A user executes a client application.
>
> The client application connects to an instance of SQL Server as the
> user.
>
> The application then executes the sp_setapprole stored procedure with
> a password known only to the application.
>
> If the application role name and password are valid, the application
> role is activated.
>
> At this point the connection loses the permissions of the user and
> assumes the permissions of the application role.
> For more detail information, you may refer the following article:
> Application Roles
> http://msdn2.microsoft.com/en-us/library/ms190998(SQL.90).aspx
> CREATE APPLICATION ROLE
> http://msdn2.microsoft.com/en-us/library/ms181491(SQL.90).aspx
>
> Hope this will be helpful.
> Sincerely,
> Wei Lu
> Microsoft Online Community Support
> ==================================================> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================> This posting is provided "AS IS" with no warranties, and confers no rights.
>|||Hi Michael,
I understand that you want to use application roles for a custom security
extension for SQL reporting services. If I misundestood your concern,
please feel free to point it out.
Application Role is a database principal that enables an application to run
with its own, user-like privileges. So Application Role is a database
security. And I think it is not suitable for the Reporting Service.
If you use application role to control the permission of SQL database then
you can not control the authentication of the Reports in the report server.
Thank your for your understanding.
Sincerely,
Wei Lu
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================This posting is provided "AS IS" with no warranties, and confers no rights.

Custom Security Extension

Hi,

My company has an application in the standard client-server architecture; The client is written in VB 6 and uses reports from the old VB 6 report designer. I am currently undertaking a project which involves transferring these reports to Reporting Services in order to allow access via the internet (a new reporting web front-end is also being designed to work in tandem with the old client). The current client has data restriction features which restrict data and report access depending on a users group - these features can be managed via the client by users with the correct privileges. In order to prevent creation and maintenance of accounts on the both the Report Server and the database for the old client (and to allows non-windows authentication) I have implemented a custom security extension which authenticates users by checking their credentials against the client's database; I also need to authorize users requests against this database however I don't seem to be able to retrieve the identity of the catalogue item that Reporting Services is requesting authorization for.

for example a report is requested; Reporting Services calls the following method:

public bool CheckAccess(string userName, IntPtr userToken, byte[] secDesc, Microsoft.ReportingServices.Interfaces.ReportOperation requiredOperation)

I can't find a way of obtaining the reports name or identity from within this method so I can use it to query the external database to ascertain authorization.

Can anybody help? Am I missing something glaringly obvious?

Your time is very much appreciated.

Adam

I have the same problem.

In RS 2000 Version, I found this information at HttpContext.Request.QueryString[0]

But in 2005 I can't find it in HttpContext..... and I need it urgently.|||I have the solution. Call this Method from IAuthorizationExtension Constructor or from your CheckAccess Method:
<code>
public string GetReportName()
{
HttpContext.Current.Request.InputStream.Position = 0;

StreamReader rd = new StreamReader(HttpContext.Current.Request.InputStream);

XmlDocument SOAPDocument = new XmlDocument();

SOAPDocument.LoadXml(rd.ReadToEnd());

HttpContext.Current.Request.InputStream.Position = 0;

XmlNamespaceManager ns = new XmlNamespaceManager(SOAPDocument.NameTable);
ns.AddNamespace("def","http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices");
ns.AddNamespace("soap", "http://schemas.xmlsoap.org/soap/envelope/");

XmlNode result = null;
result = SOAPDocument.SelectSingleNode("//def:Item",ns);

if (result == null)
{
result = SOAPDocument.SelectSingleNode("//def:Report",ns);
}
if (result == null)
{
return HttpContext.Current.Cache["ReportName"].ToString();
}

String ReportPath = result.InnerText;

string[] ReportDescription = ReportPath.Split(new char[] { '/' });

HttpContext.Current.Cache.Insert("ReportName",ReportDescription[ReportDescription.Length-1],null,DateTime.Now.AddMinutes(5),TimeSpan.Zero);

return ReportDescription[ReportDescription.Length - 1];
}
</code>|||I don't think this method will work reliably. Can you elaborate on why you need the path in the security extension - why isn't the ACL that's passed in enough to make access check decisions?|||The ACL passed in check decisions method, is based in roles configured in Report Manager.

The security of my client has his own roles. I need know de report name to ask to my client security framework which type of access has the user to this report name.

PD: Sorry for my bad english.|||

Tudor Trufinescu - MSFT wrote:

I don't think this method will work reliably. Can you elaborate on why you need the path in the security extension - why isn't the ACL that's passed in enough to make access check decisions?

I have posted exactly the same question. The ACL doesn't tell me anything about what the actual object is that the user is trying to get to. It would be helpful to know that User X is trying to execute Report Y in order to do custom authorization....

Custom Rendering Extension in SQL 2000 Reporting Services

I am trying to write a custom rendering extension for the SQL Server 2000
version of Reporting Services. The documentation I found on MSDN indicates
that it is possible to write one using Visual Studio .Net 2003 (which is what
I'm using). The samples they have are for VS.Net 2005. I'm trying to
implement it for VS.Net 2003, and I can't seem to find the references for:
Microsoft.ReportingServices.ReportRendering.IRenderingExtension
in SQL 2000 Reporting Services. What is the equivalent in SQL Server 2000
RS and Visual Studio .Net 2003?
Thanks,
Mike SandwickMicrosoft.ReportingServices.ReportRendering.IRenderingExtension is identical
in RS 2000 and RS 2005. In RS 2000 you need to add a reference to
Microsoft.ReportingServices.Processing.dll, in the final RS 2005 release it
would be Microsoft.ReportingServices.ProcessingCore.dll.
-- Robert
This posting is provided "AS IS" with no warranties, and confers no rights.
"Mike Sandwick" <MikeSandwick@.discussions.microsoft.com> wrote in message
news:F9A76586-30EE-450D-993E-7FEE3ADA1BF3@.microsoft.com...
>I am trying to write a custom rendering extension for the SQL Server 2000
> version of Reporting Services. The documentation I found on MSDN
> indicates
> that it is possible to write one using Visual Studio .Net 2003 (which is
> what
> I'm using). The samples they have are for VS.Net 2005. I'm trying to
> implement it for VS.Net 2003, and I can't seem to find the references for:
> Microsoft.ReportingServices.ReportRendering.IRenderingExtension
> in SQL 2000 Reporting Services. What is the equivalent in SQL Server 2000
> RS and Visual Studio .Net 2003?
> Thanks,
> Mike Sandwick|||Thanks, Robert. This is exactly the information I was looking for! I added
the reference to Microsoft.ReportingServices.Processing.dll, and I can now
compile the sample.
Thanks,
Mike Sandwick
"Robert Bruckner [MSFT]" wrote:
> Microsoft.ReportingServices.ReportRendering.IRenderingExtension is identical
> in RS 2000 and RS 2005. In RS 2000 you need to add a reference to
> Microsoft.ReportingServices.Processing.dll, in the final RS 2005 release it
> would be Microsoft.ReportingServices.ProcessingCore.dll.
>
> -- Robert
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
> "Mike Sandwick" <MikeSandwick@.discussions.microsoft.com> wrote in message
> news:F9A76586-30EE-450D-993E-7FEE3ADA1BF3@.microsoft.com...
> >I am trying to write a custom rendering extension for the SQL Server 2000
> > version of Reporting Services. The documentation I found on MSDN
> > indicates
> > that it is possible to write one using Visual Studio .Net 2003 (which is
> > what
> > I'm using). The samples they have are for VS.Net 2005. I'm trying to
> > implement it for VS.Net 2003, and I can't seem to find the references for:
> >
> > Microsoft.ReportingServices.ReportRendering.IRenderingExtension
> >
> > in SQL 2000 Reporting Services. What is the equivalent in SQL Server 2000
> > RS and Visual Studio .Net 2003?
> >
> > Thanks,
> > Mike Sandwick
>
>

Custom Rendering Extension for HTML Fields

I am using RS 2005, a "comments" field in a database contains HTML content. When rendering the field on the report it displays raw HTML.

Does anybody knows about a custom rendering extension that will render HTML content?

Thanks

Fernando

Has anyone resolved this? I am facing a similar issue. My website has form that takes comments via FreeTextBox. It is probably similar to what is used on this FORUM! The FreeTextBox control returns text with HTML tags throughout. I need to display the same data via Reporting Services. Currently using SQL Server 2000, Migrating to 2005 soon.

This has to be a common scenario. How about a third party control?

Thanks.

|||

This is currently not supported. See http://blogs.msdn.com/bimusings/archive/2005/12/14/503648.aspx. We are working on this for an upcoming release.

Custom Rendering Extension for HTML Fields

I am using RS 2005, a "comments" field in a database contains HTML content. When rendering the field on the report it displays raw HTML.

Does anybody knows about a custom rendering extension that will render HTML content?

Thanks

Fernando

Has anyone resolved this? I am facing a similar issue. My website has form that takes comments via FreeTextBox. It is probably similar to what is used on this FORUM! The FreeTextBox control returns text with HTML tags throughout. I need to display the same data via Reporting Services. Currently using SQL Server 2000, Migrating to 2005 soon.

This has to be a common scenario. How about a third party control?

Thanks.

|||

This is currently not supported. See http://blogs.msdn.com/bimusings/archive/2005/12/14/503648.aspx. We are working on this for an upcoming release.