I am following the sample on
https://developer.blackbaud.com/skyapi/docs/addins/concepts/addin-ssoWhen I copy the code at the bottom of the page into my solution, I have to make a couple changes to get it to compile. This is what I come up with:
public async Task<UserIdentityToken> ValidateSingleSignOnToken(string rawToken)
{
// this represents the user identity token returned from getUserIdentityToken()
// var rawToken = "(raw token value)";
// this is the ID of the developer's SKY application
Guid applicationId = new Guid("(removed for post)");
// create and validate the user identity token
UserIdentityToken uit;
try {
uit = await UserIdentityToken.ParseAsync(rawToken, applicationId);
// if valid, the UserId property contains the Blackbaud user's ID
var userId = uit.UserId;
// if valid, the EnvironmentId property contains the environment ID
var envId = uit.EnvironmentId;
return uit;
}
catch (TokenValidationException ex) {
// process the exception
return null;
}
}
When I test this code, it hangs forever on this line:
uit = await UserIdentityToken.ParseAsync(rawToken, applicationId);I have downloaded the sample solution from
https://github.com/blackbaud/addin-tokenauthenticationI am able to run the test app. I can enter a token it validates it successfully.
My project is an ASP.NET Web API. My code seems to be doing basically the same thing, however, mine hangs on that line when I test it.
Any help?