mirror of
https://github.com/mediacms-io/mediacms.git
synced 2026-01-20 07:12:58 -05:00
this
This commit is contained in:
@@ -203,9 +203,8 @@ class SelectMediaView(View):
|
|||||||
# Create JWT payload
|
# Create JWT payload
|
||||||
tool_issuer = request.build_absolute_uri('/')[:-1]
|
tool_issuer = request.build_absolute_uri('/')[:-1]
|
||||||
|
|
||||||
# Per LTI spec, aud should be the platform's issuer URL
|
# Per LTI spec, aud should be the client_id assigned by the platform
|
||||||
# Try just the platform URL (some Moodle versions don't accept arrays)
|
audience = platform.client_id
|
||||||
audience = platform.platform_id
|
|
||||||
|
|
||||||
# Get sub (subject) from original launch
|
# Get sub (subject) from original launch
|
||||||
sub = message_launch_data.get('sub')
|
sub = message_launch_data.get('sub')
|
||||||
|
|||||||
@@ -53,19 +53,25 @@ class LTINRPSClient:
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
print(f"NRPS: Attempting to fetch members. nrps_claim: {self.nrps_claim}")
|
||||||
tool_config = DjangoToolConfig.from_platform(self.platform)
|
tool_config = DjangoToolConfig.from_platform(self.platform)
|
||||||
registration = tool_config.find_registration_by_issuer(self.platform.platform_id)
|
registration = tool_config.find_registration_by_issuer(self.platform.platform_id)
|
||||||
|
|
||||||
if not registration:
|
if not registration:
|
||||||
|
print("NRPS: No registration found for platform.")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
service_connector = DjangoServiceConnector(registration)
|
service_connector = DjangoServiceConnector(registration)
|
||||||
nrps = NamesRolesProvisioningService(service_connector, self.nrps_claim)
|
nrps = NamesRolesProvisioningService(service_connector, self.nrps_claim)
|
||||||
members = nrps.get_members()
|
members = nrps.get_members()
|
||||||
|
print(f"NRPS: Successfully fetched {len(members)} members.")
|
||||||
return members
|
return members
|
||||||
|
|
||||||
except Exception:
|
except Exception as e:
|
||||||
|
print(f"NRPS Error: Failed to fetch members. Exception: {e}")
|
||||||
|
import traceback
|
||||||
|
|
||||||
|
traceback.print_exc()
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def sync_members_to_rbac_group(self, rbac_group):
|
def sync_members_to_rbac_group(self, rbac_group):
|
||||||
|
|||||||
Reference in New Issue
Block a user