Tag Archives: .NetCore

Sisense SSO implementation in MVC .net core

We can find a documentation regarding what needs to be done in Sisense BI Elastic cube manager in relation to SSO using JWT.  They also have C# code to use for SSO but one may be scratching his head if he/she wants to use that sample code in MVC .net Core application.

So for that purpose I’ld suggest to make one controller with one action in it, Use that URL of that controller action to configure in Sisense SSO configuration page. The sample code would be

 

public IActionResult Index([FromQuery]string return_to)
{
TimeSpan t = (DateTime.UtcNow – new DateTime(1970, 1, 1));
int timestamp = (int)t.TotalSeconds;
var payload = new System.Collections.Generic.Dictionary<string, object>() {
{ “iat”, timestamp},
{ “sub”, CurrentUser() },
{ “jti”, Guid.NewGuid() }
// Optional properties
// { “exp”, (int)t.Add(TimeSpan.FromMinutes(30)).TotalSeconds } // Expiration time
};
string token = Jwt.JsonWebToken.Encode(payload, “secret key from sisense sso                 configuration”, Jwt.JwtHashAlgorithm.HS256);
string redirectUrl = “http://URL_of_your_sisense_web_app_with_port/jwt?jwt=&#8221; + token;

    if (return_to != null)
{
redirectUrl += “&return_to=” + UrlEncoder.Default.Encode(return_to);
}
return Redirect(redirectUrl);

  }

}

.Net Core 1.0.0 VS 2015 Tooling Preview Installation Issue

If you are trying to install tooling preview for .net Core 1.0.0 particularly or any other version and due to some reasons you are getting errors like you need to reinstall/repair VS 2015 professional with update 3 again, than you are at  the right place

Try running the following command in the command prompt. Don’t forget to go to the directory where the setup is located

NOTE: Change the exe as per your version of the tools

DotNetCore.1.0.0-VS2015Tools.Preview2.exe SKIP_VSU_CHECK=1