Login from an external application

You can login to ReportPortal from another application without having to enter the user id and password on the Login page.

1) Make sure you can access to the ReportPortal database. The connection string to the database is stored in C:\Inetpub\wwwroot\ReportPortal\xmla.udl file.

2) Find the user you want to login as

SELECT * FROM AppUser

3) Get the security token by running GetSecurityTokenForUser stored procedure against ReportPortal database. Here is an example of getting the token for "admin" user:

exec GetSecurityTokenForUser 'admin'

Here is an example of getting the token for "admin" user with password "password1":

exec dbo.GetSecurityTokenForUserPassword 'admin', 'password1'

4) Login to the application by passing the token via a URL, for example:

http://MyServer/ReportPortal/login.aspx?token=69A7931B

Or you can login by passing a cookie to the Login page, for example:

Response.Cookies("token").Value = "69A7931B"
Response.Redirect("http://MyServer/ReportPortal/login.aspx")

5) You can have your external application insert/update ReportPortal's user table (AppUser) by calling UpdateAppUser stored procedure.

exec UpdateAppUser 'UserName1', 'Password1', 'WindowsUserId1', 'WindowsPassword1', 'JohnSmith@gmail.com', 'John', 'Smith'

Alternatively, you can update your application's user table based ReportPortal's user table:

SELECT * FROM AppUser



Code behind for Login.aspx:

VB.NET | C#