Step 9: Authenticated Joining Process for Learners

For learners, you need to add a Join Session button on your LMS for the sessions they are supposed to join

  • For each learner, the redirection URL should be created as and when they press the button. The URL for each learner will be unique and shortlived (max expiry 1min)

  • When a learner presses the Join Session button, redirect them to the following URL —

    • https://excelr.onlineclass.site/identity-based-login?jwtToken={user_JWT_token_via_SSO}&redirectionUrl=/meeting/join/{class_id}

    • In this URL, you need{user_JWT_token_via_SSO} which is the unique JWT-based login token for the learner, using the code mentioned below

    • For generating this URL, you need{user_JWT_token_via_SSO} which is the unique JWT-based login token for the student. You need to refer to the SSO integration document 🔗 for this

      // nodejs snippet
      jwt = require('jsonwebtoken')
      moment = require('moment')
      
      jwtTokenSecret = "<JWT Token secret shared by Wise>" // This SHOULD BE secret*
      
      // Redirect URL generation function on backend
      function generateJWTtoken(vendorUserId, profile, name) {
      	const payload = {
      		vendorUserId: vendorUserId, 
      		profile: profile, 
      		name: name, 
      		exp: moment().add(1, 'm').unix() 
      	}
      	const jwtToken = jwt.sign(payload, jwtTokenSecret)
      	return jwtToken
      }
      
      // Calling the function inside API to sign into Wise: 
      const user = { vendorUserId: "xyz_abc", "name": "Sam Sharma" }
      // User identified, authenticated by you in your system & fetched from your DB
      const user_jwt_token = generateJWTtoken(user.vendorUserId, user.name, "student")
      

Last updated