9 comments

  1. Didn’t work for me.. this solution brings a bigger error.

    leo Beantwoorden

  2. I’m sorry to hear that Leo. Could you tell a bit more about the error message you get?
    Security extensions can cause a variaty of exceptions under different circumstances, it’s hard to tell what’s going wrong in your situatiion without a bit more information.

    marks Beantwoorden

  3. Hey Marks, thanks for your replay. I’m not doing anything different than implement the template supplied in the samples of VS. The GetUserInfo method returns a generic identity instead of a null value. I noticed that working on the rs manager and it timeout as well. The thing is that we don’t use the manager, but we need to keep alive the builder at least for 6 hours.

    And this is the last thing I found out today. Our system calls RS web service ans retrieves the list of objects that we present to the user. You can set permissions over this folders/reports. So I set permissions to a folder for Administrator access only and logged in with a user that should not have access to this folder and it was listing and allowing access to it. After reviewing all the code and not even changing a line, I compiled as DEBUG and replaced the dll on the server and it worked. Thus the folder wasn’t showing on the list. Again, I compiled as RELEASE and replace the dll on the server and it was broken again. The difference between DEBUG and RELEASE is the DEBUG and TRACE constant definitions, everything else is the same. I can’t explain this behavior.

    Anyway, I just hope you can give me a hint for the timeout case.

    Thank you.

    leo Beantwoorden

  4. Hi leo,

    I have a problem with the Report Builder, when I create a new dataset, it stays asleep, I really do not mean this error.

    If you were so kind to explain that I am wrong.

    I have implemented custom security and the truth, I need to run the report builder, since it is a very powerful tool for us.

    What I see is that when I send the dataset to call GetUserInfo again and that’s where they stick.

    This is my code:

    public void GetUserInfo(out IIdentity userIdentity, out IntPtr userId)
    {
    // If the current user identity is not null,
    // set the userIdentity parameter to that of the current user
    if (HttpContext.Current != null && HttpContext.Current.User != null)
    {
    userIdentity = HttpContext.Current.User.Identity;
    }
    else
    // The current user identity is null. This happens when the user attempts an anonymous logon.
    // Although it is ok to return userIdentity as a null reference, it is best to throw an appropriate
    // exception for debugging purposes.
    // To configure for anonymous logon, return a Gener
    {
    userIdentity = null;
    //System.Diagnostics.Debug.Assert(false, “Warning: userIdentity is null! Modify your code if you wish to support anonymous logon.”);
    //throw new NullReferenceException(“Anonymous logon is not configured. userIdentity should not be null!”);
    }

    // initialize a pointer to the current user id to zero
    userId = IntPtr.Zero;
    }

    Rodolfo Beantwoorden

  5. @leo: You should be able to keep your session alive longer by setting the timeout to a greater value, see the following snippet from the ReportServer web.config:


    In this case the timeout is set to 60 minutes.

    Did you manage to find a solution for your DEBUG/RELEASE issue?

    marks Beantwoorden

  6. @Rodolfo: can you confirm that your extension is working as intended when you run reports through the Report Manager?
    And when your ReportBuilder freezes, does the “Object moved to..” error show up in your logfiles?

    marks Beantwoorden

  7. Thanks for this post, Mark! It’s working well for us now. After the timeout, we’re getting the cryptic error message:

    The Authentication Extension threw an unexpected exception or returned a value that is not valid: identity==null. (rsAuthenticationExtensionError)

    But we consider that a training issue.
    Thanks again!
    Joe

    Joe Zamora Beantwoorden

  8. The HTTP 500 error is being caused as a result of the null value returned from the GetUserInfo method being dereferenced. While this accomplishes the desired behavior, it would be more straightforward (and likely easier to debug, should the SSRS method invocation change to guard against a null result) to throw a AuthenticationException when a principal cannot be established.

    Regardless, thanks for the workaround here. It works as advertised!

    Brandon

    Brandon Haynes Beantwoorden

  9. This fixed the issue not only with the Report Builder but also with the SSMS for SQL2008 R2. I had a temporary user to fix an old issue in 2005 for the first authentication request (call to LogonUser) Thanks!

    Jose Beantwoorden