Testing custom provider

Originally Posted 27 May 2015, 5:25 pm EST

  • Originally Posted 27 May 2015, 5:25 pm EST

    I've created a custom security provider to authenticate users against our in house API. I notice that the ISecurityProvider interface member "CreateToken" takes three strings: Username, Password, Custom. In our existing applications we use a third field (in addition to the user/pass) to define the customer ID. The customer ID is used for multi tenancy; each of our clients has their own database. So for this reason, the "custom" field is rather useful

    When I go to configure the provider on the server, I'm given the option to test the provider. I assume that this test simply calls the "CreateToken" method. My question is this: Is there a way to test the security provider and provide a value for the "custom" argument?

  • Reply

    Hi,

    The "Testing" in the administrative dashboard only takes the username and password, since those mandatory. It not only runs the CreateToken, it also runs through the GetUserContext and GetAdminContext to show the results of the authentication and UserContext values returned from the Custom SecurityProvider.

    To test the provider with the "custom" parameter, I would suggest the use of the web-service endpoints. Here is an article about how to use them to login and get a security token: http://arhelp.grapecity.com/webhelp/AR9Server/index.html#RunningWebService.html

    The web method that you would be calling is detailed here: http://arhelp.grapecity.com/webhelp/AR9Server/index.html#LoginMethod.html

    The ASP.NET Integration sample in the SDK folder of your ActiveReports Server install directory also follows the same process. It just passes null for the custom parameter; you can pass the CustomerID.

    Let me know if this addresses your needs.

    Cheers,
    Bhupesh.
  • Reply

    Hi Bhupesh

    The testing so far has worked fine. My last question: Is there an easy way to modify the default login page to accept the extra custom parameter? If not, can I just create my own login page, create a cookie with the resulting token, and pass it into the report server site?

    Thanks,
    -Sean
  • Reply

    Hi Sean,

    In the current version of ActiveReports 9 Server, the login page is not modifiable.

    However, the best way to implement your requirements would be to use the upcoming ActiveReports 9 Server SP3 which allows you to authenticate directly with the server using an API and then passing the securityToken as part of the URL to take the user to the Report Portal directly without needing him to sign-in again.

    The SP3 is still a few weeks out, however, if you would like, we can share a preview version of the Service Pack with you.

    Please contact the sales team (activereports.sales@grapecity.com) and we will be glad to share a link to download the preview version so that you can evaluate/test the process in your environment.

    Thanks.

    Cheers,
    Bhupesh.
  • Reply

    Hi Bhupesh -

    I've got most of this working. The only part that I am unclear of is how to pass in the security token in as part of the URL. Is there documentation somewhere about this?

    Thanks,
    -Sean
  • Reply

    Here is a template URL that you can use:

    http://<ActiveReportsServer Portal URL>?authtoken=<SecurityToken>


    The "ActiveReports Server Portal URL" is the location you go to get the Login Page for the ActiveReports Server Report Portal. Typically something like http://localhost:8080 (if you are on the server locally).

    The "SecurityToken" is the token returned by the server when you authenticate the user in your code behind.

    Let me know if you run into any problems with this.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels