Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Tuesday, March 27, 2012

Forms Security Extension Sample

Hi,

I have installed the SSRS 2005 Forms based login security extension as per the sample and instructions that come with the product install. I have double checked my work and debugged up to the point explained here.

My user is in the database and I can get to the login page. I have traced the code and can see the user being authenticated properly by server.LogonUser, the authentication cookie being created and placed in the response object, and then the redirect url being set to the reports/pages/folder.aspx. I have employed tcptrace and can see the sqlAuthCookie set in subsequent posts.

Unfortunately the redirect to folder.aspx never happens. I keep returning to UILogon.aspx. I think their is something either wrong with the auth cookie or the web.config in the ReportServer IIS virtual directory. The relevant xml from the web.config is attached below.

I would appreciate any thoughts. I am running on W2K3 SP1. Thanks.

Mitch

<identity impersonate="false" />

<!--<authentication mode="Windows" />-->

<authentication mode="Forms">

<forms loginUrl="logon.aspx" name="sqlAuthCookie" timeout="60" path="/"></forms>

</authentication>

<authorization>

<deny users="?" />

</authorization>

Mitch, are you initially navigating to SSRS by using http://localhost or http://someMachineName?

If you hit your site with http://localhost/reports, you'll see the behavior you're mentioning above: (It's basically a side-effect of the way the code inside the Forms Auth sample is written). Try http://someMachineName/reports instead and see if you have better luck.

|||Thanks, that was it. Now I can proceed with integrating SSRS with IBM Tivoli Access manager!

Forms authentication sample and Win XP pro /win 2k3 server

I developed an app which uses the forms authentication sample from microsoft
as a security extension, but since i upgraded my system to sp2 it stopped
working, besides it doent work on a win2k3 server but it works on a win2k,
the problems seems to be with ssl im using the selfssl utility to get my
cerificates as im still working on a test environment, but even if i get a
test certificate from a trusted provider it tells me it doenst trust it. the
message is the following " The underlying connection was closed: Could not
establish trust relationship with remote server. "
this happens when calling the logonuser method using soap, ive tried
changing all the adresses in the config files for https but it doesnt work.Have a look at
http://support.microsoft.com/default.aspx?scid=kb;en-us;823177
I've used this to get around the same issue in a WinForms app
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Rodrigo" <Rodrigo @.discussions.microsoft.com> wrote in message
news:3D0B1EF9-B419-4B14-AC19-39BEC39F8800@.microsoft.com...
>I developed an app which uses the forms authentication sample from
>microsoft
> as a security extension, but since i upgraded my system to sp2 it stopped
> working, besides it doent work on a win2k3 server but it works on a win2k,
> the problems seems to be with ssl im using the selfssl utility to get my
> cerificates as im still working on a test environment, but even if i get a
> test certificate from a trusted provider it tells me it doenst trust it.
> the
> message is the following " The underlying connection was closed: Could
> not
> establish trust relationship with remote server. "
> this happens when calling the logonuser method using soap, ive tried
> changing all the adresses in the config files for https but it doesnt
> work.
>|||also see :
http://sqljunkies.com/WebLog/roman/archive/category/370.aspx

Forms Authentication Sample

I'm using the forms auth sample:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsql2k/html/ufairs.asp
I've followed the steps in the sample for configuring forms auth on the
/Reports and /ReportServer webs.
Forms Auth now works fine on the /ReportServer web. However, on the Report
Manager app (/Reports web), even though I authenticate correctly (I debugged
and stepped through the code), it's not redirecting to the ReturnURL. It
simply returns to the logon screen.
Here's what I've done to the Report Manager web (according to the sample
instructions):
1 - Copy Microsoft.Samples.ReportingServices.CustomSecurity.dll and
Microsoft.Samples.ReportingServices.CustomSecurity.pdb to the
<install>\ReportManager\bin directory
2- In RSWebApplication.config file I've updated the UI element:
<UI>
<CustomAuthenticationUI>
<loginUrl>/Pages/UILogon.aspx</loginUrl>
<UseSSL>False</UseSSL>
</CustomAuthenticationUI>
<ReportServerUrl>http://<server>/ReportServer</ReportServerUrl>
</UI>
*** I set UseSSL to false because this is a development environment ***
3 - In rsmgrpolicy.config I changed the PermissionSetName attribute from
Execution to FullTrust as follows:
<CodeGroup
class="FirstMatchCodeGroup"
version="1"
PermissionSetName="FullTrust"
Description="This code group grants MyComputer code Execution
permission. ">
<IMembershipCondition
class="ZoneMembershipCondition"
version="1"
Zone="MyComputer" />
4 - In the Report manager web config file:
Disabled impersonation by locating the section <identity impersonate= "true"
/> and changing it to the following: <identity impersonate="false" />.
5 - Set the Report virtual directory to Anonymous authentication
6 - In the RSReportServer.config file. Locate the <Security> element and add
the previously registered user name as follows:
<Security>
<Extension Name="Forms"
Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization,
Microsoft.Samples.ReportingServices.CustomSecurity" >
<Configuration>
<AdminConfiguration>
<UserName>username</UserName>
</AdminConfiguration>
</Configuration>
</Extension>
</Security>
***username was changed to the user I set up and should validate. ***
Note: I've made all the changes in the article with regards to the
/ReportServer web as well. And again, that web appears to be working OK.
Any idea why Forms Auth isn't working correctly on the Reports Manager web
app' Is there something else I need to do to the web.config file?Be sure to navigate to http://SERVERNAME/reports and not
http://localhost/reports. That's what got me for a while!|||Thank You !!!!
"s" <sjd0103@.comcast.net> wrote in message
news:Xns95D6A2E839377sjd0103aolcom@.207.46.248.16...
> Be sure to navigate to http://SERVERNAME/reports and not
> http://localhost/reports. That's what got me for a while!

Forms authentication sample

After successfully setting up RS on a Win2k server I've been trying to
get forms authentication sample working. I went through all the steps
given at
http://msdn.microsoft.com/sql/sqlwarehouse/reportingservices/default.aspx?pull=/library/en-us/dnsql2k/html/ufairs.asp
but when I get to the login page and try to register a user I get the
following:
An error occurred while attempting to add the account. SQL Server does
not exist or access denied.
I am having trouble finding any documentation on this. Has anyone run
into a similar problem before, and if so, what was the solution?See my other post regarding forms authentication and mixed security. Does
that solve the problem?
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Oleg Raskin" <oleg@.rhd.org> wrote in message
news:1103132329.322870.140150@.f14g2000cwb.googlegroups.com...
> After successfully setting up RS on a Win2k server I've been trying to
> get forms authentication sample working. I went through all the steps
> given at
> http://msdn.microsoft.com/sql/sqlwarehouse/reportingservices/default.aspx?pull=/library/en-us/dnsql2k/html/ufairs.asp
> but when I get to the login page and try to register a user I get the
> following:
> An error occurred while attempting to add the account. SQL Server does
> not exist or access denied.
> I am having trouble finding any documentation on this. Has anyone run
> into a similar problem before, and if so, what was the solution?
>sql

Forms Authentication sample

After successfully setting up RS on a Win2k server I've been trying to
get forms authentication sample working. I went through all the steps
given in the MSDN article but when I get to the login page and try to
register a user I get the following:
An error occurred while attempting to add the account. SQL Server does
not exist or access denied.
It's worth mentioning that RS and the database reside on 2 different
servers, but this setup was working just fine with NT-based
authentication.
I am having trouble finding any documentation on this. Has anyone run
into a similar problem before, and if so, what was the solution?
Thanks for any info.Hope you implemented your Custom Security correctly...
Try to debug -custom security- when trying to login.
b/w are you trying to login using using "Username" ?
I am able to get this(form authen) working in my last two projects and it
always works like a charm
"Oleg Raskin" wrote:
> After successfully setting up RS on a Win2k server I've been trying to
> get forms authentication sample working. I went through all the steps
> given in the MSDN article but when I get to the login page and try to
> register a user I get the following:
> An error occurred while attempting to add the account. SQL Server does
> not exist or access denied.
> It's worth mentioning that RS and the database reside on 2 different
> servers, but this setup was working just fine with NT-based
> authentication.
> I am having trouble finding any documentation on this. Has anyone run
> into a similar problem before, and if so, what was the solution?
> Thanks for any info.
>|||Is your database set to mixed security? I've had some problems with the
ReportServer service connecting to a database using SQL authentication until
I changed the Log On account (Control Panel > Administrative Tools >
Services > ReportServer) to an account that the database recognizes. I
know, that seems weird to me too, since I'm using SQL authentication for
this connection.
--
Cheers,
'(' Jeff A. Stucker
\
Business Intelligence
www.criadvantage.com
---
"Oleg Raskin" <oleg@.rhd.org> wrote in message
news:1103133182.531381.92650@.z14g2000cwz.googlegroups.com...
> After successfully setting up RS on a Win2k server I've been trying to
> get forms authentication sample working. I went through all the steps
> given in the MSDN article but when I get to the login page and try to
> register a user I get the following:
> An error occurred while attempting to add the account. SQL Server does
> not exist or access denied.
> It's worth mentioning that RS and the database reside on 2 different
> servers, but this setup was working just fine with NT-based
> authentication.
> I am having trouble finding any documentation on this. Has anyone run
> into a similar problem before, and if so, what was the solution?
> Thanks for any info.
>

forms authentication RSAccessdenied

Hello,
I try to get the sample for the forms authentication running.
I registered the first user as described in the instracutions and the user
was added to the database.
If I try to logon with this useraccount I receive the following error:
The permissions granted to user 'UserAdmin' are insufficient for performing
this operation. (rsAccessDenied)
UserAdmin is the username I created.
Have somebody expirienced this problem or have somebody a hint how I can
resolve this?
Thanks!I solved this in the following way:
I used the C Sharp instade of the vb sample. And with C# Sample the Login
seems to work.
The Report manager still doesnt work. I receive allways:
Object reference not set to an instance of an object.
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an
object.]
Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object sender, EventArgs e) +44
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +64
Can somebody help on this subject?
"Dev Main" wrote:
> Hello,
> I try to get the sample for the forms authentication running.
> I registered the first user as described in the instracutions and the user
> was added to the database.
> If I try to logon with this useraccount I receive the following error:
> The permissions granted to user 'UserAdmin' are insufficient for performing
> this operation. (rsAccessDenied)
> UserAdmin is the username I created.
> Have somebody expirienced this problem or have somebody a hint how I can
> resolve this?
> Thanks!

Forms authentication problems

Hi,
I'm implementing a custom security extension for Reporting Services,
based on the forms authentication sample, and am having a couple of
problems with authentication.
Here's some background on my set-up.
- We intend to expose reports to our customers over the internet.
Since we already have a main web application with a logon form and
authentication framework, we are sharing the authentication cookies
with that application (which lives on a different server), according
to the MSDN article 'Forms Authentication Across Applications'.
- I have implemented an authentication extension which uses this
framework to authenticate users, and it works. (I can call LogonUser
and get a cookie back if my credentials are valid, among other things.)
- Rather than having a separate logon form for Reporting Services, we
want to redirect users to/from our main logon form on the other server.
First problem: Report Manager isn't redirecting to the logon page that I
specified in the RSWebApplication.config file. Instead it is trying to
call the web service when not authenticated, and failing. (It gets
redirected to the logon page, and doesn't know what to do with it.)
The UFAIRS article doesn't say how RM works out whether the user has
an authentication cookie for the web service which needs forwarding.
Presumably it looks for one in the request, and redirects to the logon
page if the cookie isn't there. But how does it know what the cookie's
called? How does it even know that the web service is using forms
authentication (without first trying it)?
I don't know how what I'm doing is any different to the sample, which
does work. The only thing I've changed (in the Report Manager
configuration) is the loginUrl element within CustomAuthenticationUI,
but RM isn't even trying to redirect the client.
I'm also getting what I think is the same problem using Report Designer
in Visual Studio. When the sample was installed, Report Designer would
pop up a box asking for username and password whenever it tried to use
the web service, but now it just gives me an error message stating "a
connection could not be made to the report server". Again, I'm not sure
how it's trying to determine what it has to do to authenticate itself.
Second problem: redirection from the web service works, but it isn't
respecting the useFullyQualifiedRedirectUrl setting in web.config
(attribute of the httpRuntime element), which I've set to 'true'. The
URL it generates and puts in the query string is relative to the local
server root. Since my logon page is on a different server, I need it to
include the full URL.
Sorry for the long post, and thanks for reading if you got this far.
Please let me know any ideas you might have. I can post details from my
configuration files on request, and please ask if there's something I
haven't made clear. Thanks.
StephenThe name of the authentication cookie is configured in web.config under the
<forms> tag.
Perhaps you can make a call SOAP to LogonUser from your application before
the user gets to report manager. Then send the cookie to the client. Further
access to report server should be authenticated. For report manager to work
in this configuration you need to set the AllowPassthroughCookies - see the
SP1 readme for the exact name.
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stephen Kell" <skell@.opaltelecom.co.uk> wrote in message
news:pan.2004.08.04.15.24.00.797000@.opaltelecom.co.uk...
> Hi,
> I'm implementing a custom security extension for Reporting Services,
> based on the forms authentication sample, and am having a couple of
> problems with authentication.
> Here's some background on my set-up.
> - We intend to expose reports to our customers over the internet.
> Since we already have a main web application with a logon form and
> authentication framework, we are sharing the authentication cookies
> with that application (which lives on a different server), according
> to the MSDN article 'Forms Authentication Across Applications'.
> - I have implemented an authentication extension which uses this
> framework to authenticate users, and it works. (I can call LogonUser
> and get a cookie back if my credentials are valid, among other things.)
> - Rather than having a separate logon form for Reporting Services, we
> want to redirect users to/from our main logon form on the other server.
> First problem: Report Manager isn't redirecting to the logon page that I
> specified in the RSWebApplication.config file. Instead it is trying to
> call the web service when not authenticated, and failing. (It gets
> redirected to the logon page, and doesn't know what to do with it.)
> The UFAIRS article doesn't say how RM works out whether the user has
> an authentication cookie for the web service which needs forwarding.
> Presumably it looks for one in the request, and redirects to the logon
> page if the cookie isn't there. But how does it know what the cookie's
> called? How does it even know that the web service is using forms
> authentication (without first trying it)?
> I don't know how what I'm doing is any different to the sample, which
> does work. The only thing I've changed (in the Report Manager
> configuration) is the loginUrl element within CustomAuthenticationUI,
> but RM isn't even trying to redirect the client.
> I'm also getting what I think is the same problem using Report Designer
> in Visual Studio. When the sample was installed, Report Designer would
> pop up a box asking for username and password whenever it tried to use
> the web service, but now it just gives me an error message stating "a
> connection could not be made to the report server". Again, I'm not sure
> how it's trying to determine what it has to do to authenticate itself.
> Second problem: redirection from the web service works, but it isn't
> respecting the useFullyQualifiedRedirectUrl setting in web.config
> (attribute of the httpRuntime element), which I've set to 'true'. The
> URL it generates and puts in the query string is relative to the local
> server root. Since my logon page is on a different server, I need it to
> include the full URL.
> Sorry for the long post, and thanks for reading if you got this far.
> Please let me know any ideas you might have. I can post details from my
> configuration files on request, and please ask if there's something I
> haven't made clear. Thanks.
> Stephen
>|||Firstly, thanks for the reply.
> The name of the authentication cookie is configured in web.config under the
> <forms> tag.
Maybe I misunderstood, but I thought that this was only for the web
service (i.e. in ReportServer/web.config). Report Manager is using Windows
authentication itself, and doesn't have a <forms> element in its
web.config. Let me know if this is not correct.
> Perhaps you can make a call SOAP to LogonUser from your application before
> the user gets to report manager. Then send the cookie to the client. Further
> access to report server should be authenticated. For report manager to work
> in this configuration you need to set the AllowPassthroughCookies - see the
> SP1 readme for the exact name.
Thanks -- I set the PassThroughCookies configuration as required and now I
can access Report Manager. It's still not redirecting in the case of an
unauthenticated request, which would be nice to have working, but not
essential as I can log on using our form first, which generates a valid
cookie. Unfortunately though, I still get the error I described with
Report Designer, and don't have any possibility of working around that
similarly. Please let me know if you have any ideas.
Stephen|||Report manager reads the name of the authentication cookie which is sent by
the report server as an HTTP header.
Unfortunately I don't know of any solution that would allow report designer
to work in this case. As a workaround you could write your own application
that would publish reports using SOAP calls. In the SOAP client, you can
manage your custom cookies as you wish.
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stephen Kell" <skell@.opaltelecom.co.uk> wrote in message
news:pan.2004.08.05.14.48.01.766000@.opaltelecom.co.uk...
> Firstly, thanks for the reply.
> > The name of the authentication cookie is configured in web.config under
the
> > <forms> tag.
> Maybe I misunderstood, but I thought that this was only for the web
> service (i.e. in ReportServer/web.config). Report Manager is using Windows
> authentication itself, and doesn't have a <forms> element in its
> web.config. Let me know if this is not correct.
> > Perhaps you can make a call SOAP to LogonUser from your application
before
> > the user gets to report manager. Then send the cookie to the client.
Further
> > access to report server should be authenticated. For report manager to
work
> > in this configuration you need to set the AllowPassthroughCookies - see
the
> > SP1 readme for the exact name.
> Thanks -- I set the PassThroughCookies configuration as required and now I
> can access Report Manager. It's still not redirecting in the case of an
> unauthenticated request, which would be nice to have working, but not
> essential as I can log on using our form first, which generates a valid
> cookie. Unfortunately though, I still get the error I described with
> Report Designer, and don't have any possibility of working around that
> similarly. Please let me know if you have any ideas.
> Stephen
>|||Thanks. I will look into implementing a separate application to deploy
reports.
I am still a bit puzzled about how what I'm doing is substantially
different to the sample -- there's nothing special about my cookies, and
valid cookies can be generated by the RS web service as well as by our own
login page (or at least that's the idea). I'll try to investigate whether
the HTTP requests issued by RM/RD (or the responses they get) are any
different when using the sample, compared to my current installation. (Not
managed to do so yet as I don't currently have a machine with the sample
installed.)
Going back to another issue I mentioned in my first post, I don't suppose
there's any clues about why the web service doesn't generate
fully-qualified redirect URLs? I thought this was all handled by ASP.NET's
underlying FormsAuthentication implementation, but it seems like RS has
altered the normal behaviour, unless I've misunderstood something. Any
suggestions appreciated.
Stephen|||Yes, the redirect in Report manager is done only into the report manager
directory.
--
Tudor Trufinescu
Dev Lead
Sql Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stephen Kell" <skell@.opaltelecom.co.uk> wrote in message
news:pan.2004.08.06.15.52.29.703000@.opaltelecom.co.uk...
> Thanks. I will look into implementing a separate application to deploy
> reports.
> I am still a bit puzzled about how what I'm doing is substantially
> different to the sample -- there's nothing special about my cookies, and
> valid cookies can be generated by the RS web service as well as by our own
> login page (or at least that's the idea). I'll try to investigate whether
> the HTTP requests issued by RM/RD (or the responses they get) are any
> different when using the sample, compared to my current installation. (Not
> managed to do so yet as I don't currently have a machine with the sample
> installed.)
> Going back to another issue I mentioned in my first post, I don't suppose
> there's any clues about why the web service doesn't generate
> fully-qualified redirect URLs? I thought this was all handled by ASP.NET's
> underlying FormsAuthentication implementation, but it seems like RS has
> altered the normal behaviour, unless I've misunderstood something. Any
> suggestions appreciated.
> Stephen
>|||(I don't know if anyone's still reading this thread, but if so, I finally
worked out the solution and thought I'd share it.)
Thanks -- it did turn out to be something to do with the redirect
destination being outside of the application's virtual directory, but not
quite what you said. (I won't claim that my explanation matches the
intended logic behind the Reporting Services code, only that it allowed me
to understand and solve the problem I was having.)
In fact, both the RS web service and Report Manager are quite happy to
redirect outside of their virtual directory. The problem is in how their
clients interpret this.
Both Report Manager and Report Designer need some way of determining
whether to call LogonUser. If the web service redirects them to a location
inside its virtual directory, they assume this is a logon page, and do
their ask-for-credentials thing. (For Report Manager it's redirecting to
the page specified in the CustomAuthenticationUI configuration element,
while for Report Designer it's popping up that dialog asking for
credentials.) Once they have the credentials, they call LogonUser to get
their cookie.
If the web service redirects them elsewhere, they don't do any of this,
and instead fall over, in the end generating generic error messages
claiming that the report server isn't working.
I got around this by configuring the web service to redirect to a simple
aspx page (called Logon.aspx, though the name doesn't matter) in its own
virtual directory. In the Page_Load event I test whether a the User-Agent
header was received. This is a bit of magic intended to determine whether
the client is interactive (i.e. a web browser) and therefore capable of
logging in using a form, or not (e.g. a web service client like Report
Designer or Report Manager).
In the case of an interactive client, the page redirects to the (external)
login page. (The URL of the login page is read from a label in the aspx
page, so you don't need to recompile in order to change it.) You must make
sure that you also include the ReturnUrl query string parameter in your
redirect destination URL, *and* that you translate it to a fully-qualified
URL (since RS doesn't seem to do this).
For non-interactive clients, it just serves a blank page (or actually,
since I was feeling helpful, a short message about why the client wasn't
redirected, followed by the aforementioned label showing the login page
URL).
Report Manager and Report Designer now work fine. You can specify the
external login page for RM just like any other.
Sorry for the long-winded explanation -- I hope it proves useful for
someone.
Stephen

Forms Authentication Problem

Hello,
I try (since days) to the sample for forms authentication running.
I realy checked everything more then twice and searched all posts I can find
in the whole web (many, many people have exact the same problem).
The following error I receive on the http://localhost/reports
Object reference not set to an instance of an object.
[NullReferenceException: Object reference not set to an instance of an
object.]
Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object sender, EventArgs e) +44
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +64
I can not get the code running in debug mode on the reportmanager call. It
works meanwhile for the reportserver (but not reportmanager). As mentoined
above I check configuration files many times, started from scratch, following
absolut exactly the instruction.
The web is overfload with people facing this problem and blaming the MSDN
Article. It is impossible, that it is not soved from somebody. Please, please
help.
My envoirenment:
W2K3 Server SP2
SQL Server 2005 Standard Edition
Visual Studio 2005 ProfessionellHere is what I found in the event log:
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: Web Event
Event ID: 1309
Date: 1/16/2008
Time: 2:17:27 AM
User: N/A
Computer: DEV01
Description:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 1/16/2008 2:17:27 AM
Event time (UTC): 1/16/2008 1:17:27 AM
Event ID: c78ec383608f4fc4952de607739a1a9f
Event sequence: 7
Event occurrence: 4
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/Root/Reports-11-128449164206843494
Trust level: RosettaMgr
Application Virtual Path: /Reports
Application Path: C:\Program Files\Microsoft SQL
Server\MSSQL.3\Reporting Services\ReportManager\
Machine name: DEV01
Process information:
Process ID: 3008
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE
Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
Request information:
Request URL: http://localhost/Reports/Home.aspx
Request path: /Reports/Home.aspx
User host address: 127.0.0.1
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE
Thread information:
Thread ID: 9
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at
Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object sender, EventArgs e)
at
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
"Dev Main" wrote:
> Hello,
> I try (since days) to the sample for forms authentication running.
> I realy checked everything more then twice and searched all posts I can find
> in the whole web (many, many people have exact the same problem).
> The following error I receive on the http://localhost/reports
> Object reference not set to an instance of an object.
> [NullReferenceException: Object reference not set to an instance of an
> object.]
> Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object sender, EventArgs e) +44
> System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
> I can not get the code running in debug mode on the reportmanager call. It
> works meanwhile for the reportserver (but not reportmanager). As mentoined
> above I check configuration files many times, started from scratch, following
> absolut exactly the instruction.
> The web is overfload with people facing this problem and blaming the MSDN
> Article. It is impossible, that it is not soved from somebody. Please, please
> help.
> My envoirenment:
> W2K3 Server SP2
> SQL Server 2005 Standard Edition
> Visual Studio 2005 Professionell
>|||I found a working solution, see link below.
The article about the sample application is not complete and will not work
without the settings described in the article I found.
Thank you Microsoft for one more time wasting 2 days of my life!
http://groups.google.de/group/microsoft.public.sqlserver.reportingsvcs/browse_thread/thread/2531fa152c2b49fc/92bb051ebc9d7251?hl=de&lnk=st&q=forms+authentication+Report+manager#92bb051ebc9d7251
"Dev Main" wrote:
> Hello,
> I try (since days) to the sample for forms authentication running.
> I realy checked everything more then twice and searched all posts I can find
> in the whole web (many, many people have exact the same problem).
> The following error I receive on the http://localhost/reports
> Object reference not set to an instance of an object.
> [NullReferenceException: Object reference not set to an instance of an
> object.]
> Microsoft.ReportingServices.UI.GlobalApp.Application_AuthenticateRequest(Object sender, EventArgs e) +44
> System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
> System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously) +64
> I can not get the code running in debug mode on the reportmanager call. It
> works meanwhile for the reportserver (but not reportmanager). As mentoined
> above I check configuration files many times, started from scratch, following
> absolut exactly the instruction.
> The web is overfload with people facing this problem and blaming the MSDN
> Article. It is impossible, that it is not soved from somebody. Please, please
> help.
> My envoirenment:
> W2K3 Server SP2
> SQL Server 2005 Standard Edition
> Visual Studio 2005 Professionell
>

Monday, March 26, 2012

Forms Authentication + Report Builder 2005

I've got Reporting Services 2005 successfully setup using the forms
authentication extension sample that ships with 2005, and have even got
Report Builder up and running having followed a workaround involving a
HTTP filter
(http://blogs.msdn.com/bimusings/archive/2005/11/29/497848.aspx).
The problem that I have is that I cannot view reports through Report
Builder as any user other than the default administrator, get the error
message:
The permissions granted to user '<formsuser>' are
insufficient for performing this operation. (rsAccessDenied)
Anyone any similar experiences? Any user can create and deploy reports
but it is only the admin that can view reports in Report Builder.
Thanks,
SiThis is exactly the behavior you should see if the user does not have
permission to the Execute Report Definitions system task. This permission is
required to view reports in Report Builder because RB executes the
(potentially modified) report definitions on-the-fly, without saving them to
the report server first.
If you go to Site Settings->Configure Site-wide Security in Report Manager,
you should be able to add your non-admin user to the System User role, which
has permission to the Execute Report Definitions task by default (unless you
upgraded your server from 2000, in which case you will need to add the
permission to the role manually).
Hope this helps!
"si.downes@.gmail.com" wrote:
> I've got Reporting Services 2005 successfully setup using the forms
> authentication extension sample that ships with 2005, and have even got
> Report Builder up and running having followed a workaround involving a
> HTTP filter
> (http://blogs.msdn.com/bimusings/archive/2005/11/29/497848.aspx).
> The problem that I have is that I cannot view reports through Report
> Builder as any user other than the default administrator, get the error
> message:
> The permissions granted to user '<formsuser>' are
> insufficient for performing this operation. (rsAccessDenied)
> Anyone any similar experiences? Any user can create and deploy reports
> but it is only the admin that can view reports in Report Builder.
> Thanks,
> Si
>|||that's fixed it. thanks!
Bob Meyers - MSFT wrote:
> This is exactly the behavior you should see if the user does not have
> permission to the Execute Report Definitions system task. This permission is
> required to view reports in Report Builder because RB executes the
> (potentially modified) report definitions on-the-fly, without saving them to
> the report server first.
> If you go to Site Settings->Configure Site-wide Security in Report Manager,
> you should be able to add your non-admin user to the System User role, which
> has permission to the Execute Report Definitions task by default (unless you
> upgraded your server from 2000, in which case you will need to add the
> permission to the role manually).
> Hope this helps!
> "si.downes@.gmail.com" wrote:
> > I've got Reporting Services 2005 successfully setup using the forms
> > authentication extension sample that ships with 2005, and have even got
> > Report Builder up and running having followed a workaround involving a
> > HTTP filter
> > (http://blogs.msdn.com/bimusings/archive/2005/11/29/497848.aspx).
> > The problem that I have is that I cannot view reports through Report
> > Builder as any user other than the default administrator, get the error
> > message:
> >
> > The permissions granted to user '<formsuser>' are
> > insufficient for performing this operation. (rsAccessDenied)
> >
> > Anyone any similar experiences? Any user can create and deploy reports
> > but it is only the admin that can view reports in Report Builder.
> >
> > Thanks,
> >
> > Si
> >
> >|||Si,
Are you having users access report builder from the internet? When using the
forms authentication is there any loss of features in reporting services? I
thought I read somewhere that if forms authentication was used, either not
all of the features of reporting services were available or you had to
manually do a lot of coding to enable all of the features. I may have
misunderstood the article however.
Thanks,
--
Dan D.
"si.downes@.gmail.com" wrote:
> that's fixed it. thanks!
> Bob Meyers - MSFT wrote:
> > This is exactly the behavior you should see if the user does not have
> > permission to the Execute Report Definitions system task. This permission is
> > required to view reports in Report Builder because RB executes the
> > (potentially modified) report definitions on-the-fly, without saving them to
> > the report server first.
> >
> > If you go to Site Settings->Configure Site-wide Security in Report Manager,
> > you should be able to add your non-admin user to the System User role, which
> > has permission to the Execute Report Definitions task by default (unless you
> > upgraded your server from 2000, in which case you will need to add the
> > permission to the role manually).
> >
> > Hope this helps!
> >
> > "si.downes@.gmail.com" wrote:
> >
> > > I've got Reporting Services 2005 successfully setup using the forms
> > > authentication extension sample that ships with 2005, and have even got
> > > Report Builder up and running having followed a workaround involving a
> > > HTTP filter
> > > (http://blogs.msdn.com/bimusings/archive/2005/11/29/497848.aspx).
> > > The problem that I have is that I cannot view reports through Report
> > > Builder as any user other than the default administrator, get the error
> > > message:
> > >
> > > The permissions granted to user '<formsuser>' are
> > > insufficient for performing this operation. (rsAccessDenied)
> > >
> > > Anyone any similar experiences? Any user can create and deploy reports
> > > but it is only the admin that can view reports in Report Builder.
> > >
> > > Thanks,
> > >
> > > Si
> > >
> > >
>

Forms Authentication : Object moved

Oops!
Sorry I don't know why I sent that without a question :-)
Basically, I've implimented the Forms Authentication sample, and now
the following code causes the error above.
ReportingService rs = new ReportingService();
rs.LogonUser("UserWithBlankPassword",String.Empty, null);
BatchHeader BH = new BatchHeader();
BH.BatchID = rs.CreateBatch();
rs.BatchHeaderValue = BH;
ScheduleDefinition SD = new ScheduleDefinition();
SD = ((ScheduleDefinition)S.ScheduleDefinition);
string scheduleid = rs.CreateSchedule(R.ReportId.ToString() + "_" +
EBCUserId.ToString(),SD);
rs.ExecuteBatch();
Anyone got any ideas?
Thanks,
Phil Winstanley
Microsoft ASP.NET MVPPhil,
It may be because the authentication ticket (sqlAuthCookie) is not passed to
the Report Server. The successful output of the LogonUser call is an
in-session cookie sent to the browser (just like ASP.NET Forms
Authentication). I think what is happening in your case is that you are
generating the cookie on the same page on which you are trying to pass it
back. Do a tcp trace to find out if the cookie is sent to the Report Server.
If not, you may need to move the subsequent SOAP calls to another page after
a redirect.
--
Hope this helps.
---
Teo Lachev, MCSD, MCT
Author: "Microsoft Reporting Services in Action"
http://www.prologika.com
"Phil Winstanley [Microsoft MVP ASP.NET]" <phil@.winstanley.name> wrote in
message news:cffcgk$ol3@.odak26.prod.google.com...
> Oops!
> Sorry I don't know why I sent that without a question :-)
> Basically, I've implimented the Forms Authentication sample, and now
> the following code causes the error above.
> ReportingService rs = new ReportingService();
> rs.LogonUser("UserWithBlankPassword",String.Empty, null);
> BatchHeader BH = new BatchHeader();
> BH.BatchID = rs.CreateBatch();
> rs.BatchHeaderValue = BH;
> ScheduleDefinition SD = new ScheduleDefinition();
> SD = ((ScheduleDefinition)S.ScheduleDefinition);
> string scheduleid = rs.CreateSchedule(R.ReportId.ToString() + "_" +
> EBCUserId.ToString(),SD);
> rs.ExecuteBatch();
> Anyone got any ideas?
> Thanks,
> Phil Winstanley
> Microsoft ASP.NET MVP
>

Forms Authentication

Hi,
After two days of work I can't resolve my problem. I implemented the
Custom Security Sample. The http://myMachineName/Reportserver work
properly when I connected it.
I started getting the following error when I try to connect to Report
Manager:
Access denied
The Report Service is installed in my machine and the Report Server
Database in another server.
Can anybody help me please?
Thanks.Gave,
Did you disable impersonation for the Report Manager Virtual Directory?
Are you logging into Report Manager with the same username defined in
the node
<AdminConfiguration>
<UserName>username</UserName>
</AdminConfiguration>
in the RSReportServer.config file?
Andy Potter
Andy Potter|||Andy,
Thanks for the reply
Yes, in Report Manager Virtual Directory the anonymous access is
checked and I used the same user that are in RSReportServer.config
file.
What other issue can be?
Thanks.
Potter ha escrito:
> Gave,
> Did you disable impersonation for the Report Manager Virtual Directory?
> Are you logging into Report Manager with the same username defined in
> the node
> <AdminConfiguration>
> <UserName>username</UserName>
> </AdminConfiguration>
> in the RSReportServer.config file?
> Andy Potter
>
>
> Andy Potter|||Gave,
Put some breakpoints in your extension and step through the CheckAccess
overloads in the Authorization.cs class. Specifically, look at the
comparison that checks to see if the user logging in matches the
administrator username.
// If the user is the administrator, allow unrestricted access.
if (0 == String.Compare(userName, m_adminUserName, true,
CultureInfo.CurrentCulture))
return true;
Andy Potter|||Andy,
Thanks again. I resolved my problem; I forgot to change <identity
impersonate="true"/> to <identity impersonate="false"/>.
Sorry and Thanks a lot for your time.
Gave.
Potter ha escrito:
> Gave,
> Put some breakpoints in your extension and step through the CheckAccess
> overloads in the Authorization.cs class. Specifically, look at the
> comparison that checks to see if the user logging in matches the
> administrator username.
> // If the user is the administrator, allow unrestricted access.
> if (0 == String.Compare(userName, m_adminUserName, true,
> CultureInfo.CurrentCulture))
> return true;
> Andy Pottersql

formatting textboxes

I am rendering a report in VS 2003 and I need to know:
1) If it's possible to combine two different text formats in one textbox?
Sample database field = Notes.description
I want to be able to manually add the word "Notes: " (which I want to be
bold) in front of the data that's in the Notes.description field (which I
want to be normal) and appear as one group of text. I tried {="Notes: " +
Fields!Description.Value} but the format applies to the entire box. The only
way I have found to work around this is to have two side by side textboxes.
Is this possible to do without the side by side textboxes? Sometimes the
text in the Notes.description field will be long, and if the textboxes are
side by side, I won't get the text to appear as though it is "wrapping"
around the "Notes:" textbox.
2) Also, when I do need to use the side by side textboxes, is it possible
to dynamically move the position of the second textbox according to the
growth and shrinkage of the first? I would like for the text in the second
box to always come immediately after the text in the first box, no matter how
long or short the leading textbox is.
Please advise if you can.
Thanks.Like you, I tried to apply different formats to text within a textbox.
I even tried embeding html code to change the format and the code and
text would show. I concluded it just can't be done.
As for q-2, dynamicly changing the textbox postion may be possible in
a list but not in tables or matrix.
Mark
On Fri, 5 May 2006 14:51:02 -0700, dataGirl
<dataGirl@.discussions.microsoft.com> wrote:
>I am rendering a report in VS 2003 and I need to know:
>1) If it's possible to combine two different text formats in one textbox?
>Sample database field = Notes.description
>I want to be able to manually add the word "Notes: " (which I want to be
>bold) in front of the data that's in the Notes.description field (which I
>want to be normal) and appear as one group of text. I tried {="Notes: " +
>Fields!Description.Value} but the format applies to the entire box. The only
>way I have found to work around this is to have two side by side textboxes.
>Is this possible to do without the side by side textboxes? Sometimes the
>text in the Notes.description field will be long, and if the textboxes are
>side by side, I won't get the text to appear as though it is "wrapping"
>around the "Notes:" textbox.
>2) Also, when I do need to use the side by side textboxes, is it possible
>to dynamically move the position of the second textbox according to the
>growth and shrinkage of the first? I would like for the text in the second
>box to always come immediately after the text in the first box, no matter how
>long or short the leading textbox is.
>Please advise if you can.
>Thanks.
>
>

Sunday, February 26, 2012

Format for a bigint parameter in Raiserror

Having a small problem with RAISERROR that I've isolated to a small code sample:

The objective is to have the message string in Raiserror correctly report the value of a parameter that is a bigint. The following extract shows the problem:

ALTER PROCEDURE [dbo].[pr_Test]

@.SomeNumber bigint

AS

BEGIN

SET NOCOUNT ON;

RAISERROR('Test Error Number: %d.',16,1,@.SomeNumber)

END

As written, when the procedure is executed with the value 1 passed in the @.SomeNumber parameter, the result is:

Msg 2786, Level 16, State 1, Procedure pr_Test, Line 19

The data type of substitution parameter 1 does not match the expected type of the format specification.

If the datatype for @.SomeNumber is changed to int, then the procedure executes correctly and reports 'Test Error Number: 1'. Any suggestions on how to fix this problem?

Regards,

Flavelle

There seems to a limitation with the numeric data type while using the Raiserror statement.

My suggestion is to cast the bigint to a varchar Here is the modified code block

alter PROCEDURE [dbo].[pr_Test]

@.SomeNumber BIGINT

AS

BEGIN

DECLARE @.NewNumber VARCHAR(1000)

SET @.NewNumber=CAST(@.SomeNumber AS VARCHAR(100))

SET NOCOUNT ON;

RAISERROR('Test Error Number: %s',16,1, @.NewNumber)

END

|||

Have you looked at the definition for RAISERROR in Books Online? It says bigint is not a valid datatype for that parameter.

argument

Is the parameters used in the substitution for variables defined in msg_str or the message corresponding to msg_id. There can be 0 or more substitution parameters; however, the total number of substitution parameters cannot exceed 20. Each substitution parameter can be a local variable or any of these data types: int1, int2, int4, char, varchar, binary, or varbinary. No other data types are supported.

|||yes, i misread your post, and yes, casting/converting to a varchar datatype is a simple fix/workaround.|||

My thanks to you both - brokenrulz for the solution to the problem and Greg for reminding me that I have to remember to read the ENTIRE help file. Your reference to the supported datatypes for the parameters is deeply buried within the help topic.

Regards,

Flavelle

|||

Hello,

Help files have been updated on July 2006 (http://msdn2.microsoft.com/en-us/library/ms178592.aspx) and it says "To convert a value to the Transact-SQL bigint data type, specify %I64d" (the letter before 64 begin a capital i).

Not need to cast the bigint into an nvarchar. I tested under SQL 2005 + SP (version 9.00.3054.00) and it works great.

Laurent

|||I was facing the same problem and your suggestion saved the day for me. A big thanks.

Format for a bigint parameter in Raiserror

Having a small problem with RAISERROR that I've isolated to a small code sample:

The objective is to have the message string in Raiserror correctly report the value of a parameter that is a bigint. The following extract shows the problem:

ALTER PROCEDURE [dbo].[pr_Test]

@.SomeNumber bigint

AS

BEGIN

SET NOCOUNT ON;

RAISERROR('Test Error Number: %d.',16,1,@.SomeNumber)

END

As written, when the procedure is executed with the value 1 passed in the @.SomeNumber parameter, the result is:

Msg 2786, Level 16, State 1, Procedure pr_Test, Line 19

The data type of substitution parameter 1 does not match the expected type of the format specification.

If the datatype for @.SomeNumber is changed to int, then the procedure executes correctly and reports 'Test Error Number: 1'. Any suggestions on how to fix this problem?

Regards,

Flavelle

There seems to a limitation with the numeric data type while using the Raiserror statement.

My suggestion is to cast the bigint to a varchar Here is the modified code block

alter PROCEDURE [dbo].[pr_Test]

@.SomeNumber BIGINT

AS

BEGIN

DECLARE @.NewNumber VARCHAR(1000)

SET @.NewNumber=CAST(@.SomeNumber AS VARCHAR(100))

SET NOCOUNT ON;

RAISERROR('Test Error Number: %s',16,1, @.NewNumber)

END

|||

Have you looked at the definition for RAISERROR in Books Online? It says bigint is not a valid datatype for that parameter.

argument

Is the parameters used in the substitution for variables defined in msg_str or the message corresponding to msg_id. There can be 0 or more substitution parameters; however, the total number of substitution parameters cannot exceed 20. Each substitution parameter can be a local variable or any of these data types: int1, int2, int4, char, varchar, binary, or varbinary. No other data types are supported.

|||yes, i misread your post, and yes, casting/converting to a varchar datatype is a simple fix/workaround.|||

My thanks to you both - brokenrulz for the solution to the problem and Greg for reminding me that I have to remember to read the ENTIRE help file. Your reference to the supported datatypes for the parameters is deeply buried within the help topic.

Regards,

Flavelle

|||

Hello,

Help files have been updated on July 2006 (http://msdn2.microsoft.com/en-us/library/ms178592.aspx) and it says "To convert a value to the Transact-SQL bigint data type, specify %I64d" (the letter before 64 begin a capital i).

Not need to cast the bigint into an nvarchar. I tested under SQL 2005 + SP (version 9.00.3054.00) and it works great.

Laurent

|||I was facing the same problem and your suggestion saved the day for me. A big thanks.