Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomSecuritySample: Still Windows authentication after changes #21

Closed
danielnord opened this issue May 4, 2017 · 5 comments
Closed

Comments

@danielnord
Copy link

I'm rather sure I have missed something but cannot figure it out and I have followed the guide step by step. The main difference is that I have SQL2016 as instance name but otherwise nothing special.

Expected result

I expected that after a restart of the services a logon screen should be provided when entering http://computername/Reports in the browser. But instead I still get an Windows authentication prompt. I think that I miss some final steps in the guide that needs to be done to make it work but cannot figure out what

Setup

Instance name: SQL2016
URL set in Reporting Services Configuration Manager: http://computername/Reports

Configuration steps taken

The following changes have been made where I followed the README:

RSReportServer.config:

Set AuthenticationTypes to Custom:

<AuthenticationTypes>
  <Custom/>
</AuthenticationTypes>

Replaced UI with new data:

<UI>
  <CustomAuthenticationUI>
    <loginUrl>/Pages/UILogon.aspx</loginUrl>
    <UseSSL>False</UseSSL>
    <PassThroughCookies>
      <PassThroughCookie>sqlAuthCookie</PassThroughCookie>
    </PassThroughCookies>
  </CustomAuthenticationUI>
  <ReportServerUrl>http://computername/Reports</ReportServerUrl>
  <PageCountMode>Estimate</PageCountMode>
</UI>

Replaced Security extension information with:

<Extension Name="Forms" 
  Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity" >
  <Configuration>
    <AdminConfiguration>
      <UserName>username</UserName>
    </AdminConfiguration>
  </Configuration>
</Extension>

Replaced Authentication extension with:

<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension,Microsoft.Samples.ReportingServices.CustomSecurity" />

RSSrvPolicy.config:

Added a new code group:

<CodeGroup
  class="UnionCodeGroup"
  version="1"
  Name="SecurityExtensionCodeGroup"
  Description="Code group for the sample security extension"
  PermissionSetName="FullTrust">
  <IMembershipCondition
    class="UrlMembershipCondition"
    version="1"
    Url="C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll"/>
</CodeGroup>

Web.config:

Added under system.web:

<machineKey validationKey="GENERATED_VALIDATION_KEY" decryptionKey="GENERATED_DECRYPTION_KEY" validation="AES" decryption="AES" />

Changed authentication mode from Windows to Forms and added authorization and identity impersonation:

<authentication mode="Forms">
      <forms loginUrl="logon.aspx" name="sqlAuthCookie" timeout="60" path="/"></forms>
</authentication>
<authorization>
  <deny users="?" />
</authorization>
<identity impersonate="false" />

RSWebApp/Microsoft.ReportingServices.Portal.WebHost.exe.config:

Added the same validation and decryption key as in Web.config for Reporting services

<system.web>
  <machineKey validationKey="GENERATED_VALIDATION_KEY" decryptionKey="GENERATED_DECRYPTION_KEY" validation="AES" decryption="AES" />
</system.web>

Copy files to right places

C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\RSWebApp:

  • Copy Microsoft.ReportingServices.Portal.WebHost.exe.config

C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer:

  1. Copy the other three config files mentioned above
  2. Copy Login.aspx and .cs
  3. Copy Microsoft.Samples.ReportingServices.CustomSecurity.dll into /bin
@gboreki
Copy link
Contributor

gboreki commented May 4, 2017

Hi Daniel,

Based on your changes, just restarting the service and your browser should be sufficient. You can also try to hit the /reportserver endpoint to check if the issue is specific to the portal or to both endpoints.

This initial login is defined basically by the entry in the web.config, you can check in the server logs for which AuthenticationType is actually being loaded.

Do you have any other SSRS instances installed in this machine?

Thanks
-Boreki

@danielnord
Copy link
Author

@gboreki Thank you for feedback.
I looked at the logs after I entered /ReportServer endpoint and I think I have missed one thing because the logs that was written to was not inside C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\LogFiles but instead inside C:\Program Files\Microsoft SQL Server Reporting Services\RSServer\LogFiles

Does this imply that I should add the CustomSecuritySample DLL inside C:\Program Files\Microsoft SQL Server Reporting Services\RSServer\ReportServer rather than C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer?

I have only one instance installed according to Reporting Services Configuration Manager.
Worth noting is that I'm using the preview build including Power BI.

@jtarquino
Copy link
Member

The preview doesn't support multi instance, you will have only the RSServer instance and there is where you need to do the changes.
Also being a preview not all the features supports custom authentication

@danielnord
Copy link
Author

This was the reason. When I changed the Standalone instance and restarted the services the logon page shows up. Case closed.

Thank you very much for your help.

Kind regards
Daniel

@Jaso2592
Copy link

Jaso2592 commented Jul 1, 2020

When i register a user that user is not get admin is a normal user and i need that user as admin.
can someone help me please
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants