Connecting javascript SinglePageApplications to Turnkey (SPA)
(Created page with "In order to connect SPA's built with pure-javascript or React or Angular or Vue or anthing else we must address these needs: # Cors - allow foreign apps to query our Turnkey s...")
 
No edit summary
Line 7: Line 7:
If you follow all the instructions there you soon have a SPA application that logs in with Azure AD - and gives you idToken that are in jwt format (really jws as they are signed).
If you follow all the instructions there you soon have a SPA application that logs in with Azure AD - and gives you idToken that are in jwt format (really jws as they are signed).


Once you have this example - follow the lead and add another button:
Once you have this example - follow the lead and add another button, just like the readMail and seeProfile buttons from the sample:

Revision as of 22:20, 28 February 2021

In order to connect SPA's built with pure-javascript or React or Angular or Vue or anthing else we must address these needs:

  1. Cors - allow foreign apps to query our Turnkey server
  2. Authentication - allow foreign apps to acquire a jwt from somewhere (Oauth host) and we want to check it and possibly accept it
  3. Stay logged in - with a cookie after initial authentication

To show this we can use the Microsoft SPA example from here : https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-javascript-auth-code

If you follow all the instructions there you soon have a SPA application that logs in with Azure AD - and gives you idToken that are in jwt format (really jws as they are signed).

Once you have this example - follow the lead and add another button, just like the readMail and seeProfile buttons from the sample:

This page was edited 98 days ago on 02/10/2024. What links here