trouble validating user identity token
I am following the sample on https://developer.blackbaud.com/skyapi/docs/addins/concepts/addin-sso
When 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:
I have downloaded the sample solution from https://github.com/blackbaud/addin-tokenauthentication
I 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?
When 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:
When I test this code, it hangs forever on this line:
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;
}
}
uit = await UserIdentityToken.ParseAsync(rawToken, applicationId);I have downloaded the sample solution from https://github.com/blackbaud/addin-tokenauthentication
I 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?
0
Comments
-
Blackbaud who can take a look at this question for us? We are trying to build SKY Add-Ins and this is one of our roadblocks. Any assistance would be greatly appreciated!0
-
Did either of you find a solution to this issue?
I'm running into it now too. Thanks!0 -
OK, I did some more digging and if your issue is like mine, I think it's due to a bug in the Blackbaud.Addin.TokenAuthentication library.
In my project I'm calling the code from a non-async method and so calling GetAwaiter().GetResult() to block until the token gets parsed. But the library code didn't have any calls to ConfigureAwait(false), so if it gets called from somewhere with limited concurrent operations you can get a deadlock (more info here: https://devblogs.microsoft.com/dotnet/configureawait-faq/).
I've created a PR that fixes the deadlock in my application: https://github.com/blackbaud/addin-tokenauthentication/pull/13
If someone from Blackbaud could review that would be great!0 -
Following up on this thread, I see that Matthew's PR has been merged (thanks for the contribution!). Jeff, if pulling in the latest version of the library doesn't fix your problem please let us know.
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 206 bbcon®
- 1.4K Blackbaud Altru®
- 394 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 357 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 646 Blackbaud Grantmaking™
- 561 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 934 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.4K Blackbaud Raiser's Edge NXT®
- 3.6K SKY Developer
- 242 ResearchPoint™
- 118 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 238 The Tap (Just for Fun)
- 33 Blackbaud Community Challenges
- 28 PowerUp Challenges
- 3 (Open) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 778 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)



