Add-in Single Sign-on with a Node.js backend
Gary Chamberlain
New Member
I'm following the instructions at https://developer.blackbaud.com/skyapi/docs/addins/concepts/addin-sso and they seem pretty straight-forward. However, I got to the point where I need to validate the UIT. The docs only give a C# example but we are using Node.
- Do I need to use a third-party openId client?
- Can someone point me to example code?
0
Comments
-
I've figured out how to do it myself and will list the steps here in case someone else is looking for this.
- Client
- Follow the Blackbaud's SSO instructions and get the Id Token by calling client.getUserIdentityToken()
- POST to your Node server and pass the token in a header
- Node (Express app middleware)
- npm install jsonwebtoken --save
- Get the PEM cert
- await fetch('https://oauth2.sky.blackbaud.com/.well-known/openid-configuration')
- Read the jwks_uri value
- await fetch(jwks_uri)
- Read the JWK set (array of keys)
- Parse the token header
- Split the token on a persiod
- Base64 decode the first element and JSON parse
- Extract the x5t and kid values
- Loop through each key and take the first one that matches either the x5t or kid
- Take the first element in the x5c as the cert
- Prepend '-----BEGIN CERTIFICATE-----' to the cert
- Append ''-----END CERTIFICATE-----" to the cert
- Build an options POJO with expected algorithms, audience and issuer values.
- Call jwt.verify(token, cert, options, function(err, decoded) { ... });
- In the callback, decoded is the payload. Handle the error or call next()
1 - Client
Categories
- All Categories
- 6 Blackbaud Community Help
- 212 bbcon®
- 1.4K Blackbaud Altru®
- 399 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 654 Blackbaud Grantmaking™
- 571 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 939 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.6K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 34 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) 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
- 789 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)