Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
use Firebase\JWT\JWT; 

$privateKey = 'YOUR_PRIVATE_KEY';

// Create the array containing the user information
$payload= array(
		'email' => $userEmail,
		'name' => $userName,
		'workspace_id' => $workspaceId,
		'sso_id' => $ssoId,
		'iat' => time(),
		'exp' => time() + 300
);

// Generate the JWT token
$jwtToken = JWT::encode($payload, $privateKey, 'HS256');

//redirect the user back to your white label domain
header('https://your-white-label-domain/sso/auth?token=' . $jwtToken);

Video Tutorial

...