Skip to content

Commit 237bd73

Browse files
committed
feat: use email institutional on Blackboard integration
1 parent e144223 commit 237bd73

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Controller/LTILaunchController.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ public function launch(Request $request): Response
3737
$token = $request->request->get('id_token');
3838
$state = $request->request->get('state');
3939
$origin = $request->headers->get('origin');
40+
$blackboardOrigin = false;
4041

4142
$client = $this->documentManager->getRepository(LTIClient::class)->findOneBy(['issuer' => $origin]);
4243
if (!$client) {
4344
$client = $this->documentManager->getRepository(LTIClient::class)->findOneBy(['issuer' => 'https://developer.blackboard.com/']);
4445
if (!$client) {
4546
throw new \Exception('Client not found.');
4647
}
48+
$blackboardOrigin = true;
4749
}
4850

4951
$jwksUri = $client->getJWKSUri();
@@ -57,6 +59,9 @@ public function launch(Request $request): Response
5759
$userID = $decodedToken->{'https://purl.imsglobal.org/spec/lti/claim/custom'}->userID;
5860
$username = $decodedToken->{'https://purl.imsglobal.org/spec/lti/claim/custom'}->username;
5961
$mail = $decodedToken->{'https://purl.imsglobal.org/spec/lti/claim/custom'}->person_email;
62+
if ($blackboardOrigin) {
63+
$mail = $decodedToken->{'https://purl.imsglobal.org/spec/lti/claim/custom'}->person_email_institutional;
64+
}
6065
$fullName = $decodedToken->{'https://purl.imsglobal.org/spec/lti/claim/custom'}->person_fullname;
6166
$roles = $decodedToken->{'https://purl.imsglobal.org/spec/lti/claim/roles'};
6267

0 commit comments

Comments
 (0)