Skip to content

Commit 011f65a

Browse files
committed
Set user UPN in member provisioning
1 parent 906284c commit 011f65a

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/api/functions/entraId.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
EntraGroupMetadata,
2626
EntraInvitationResponse,
2727
ProfilePatchRequest,
28+
ProfilePatchWithUpnRequest,
2829
} from "../../common/types/iam.js";
2930
import { UserProfileData } from "common/types/msGraphApi.js";
3031
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
@@ -431,7 +432,7 @@ export async function patchUserProfile(
431432
token: string,
432433
email: string,
433434
userId: string,
434-
data: Partial<ProfilePatchRequest>,
435+
data: Partial<ProfilePatchWithUpnRequest>,
435436
): Promise<void> {
436437
try {
437438
const url = `https://graph.microsoft.com/v1.0/users/${userId}`;

src/api/functions/membership.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ export async function setPaidMembership({
338338
displayName: `${firstName} ${lastName}`,
339339
givenName: firstName,
340340
surname: lastName,
341+
userPrincipalName: `${netId}@acm.illinois.edu`,
341342
});
342343

343344
return { updated: true };

src/common/types/iam.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,5 @@ export const entraProfilePatchRequest = z.object({
8383
});
8484

8585
export type ProfilePatchRequest = z.infer<typeof entraProfilePatchRequest>;
86+
87+
export type ProfilePatchWithUpnRequest = ProfilePatchRequest & { userPrincipalName?: string }

0 commit comments

Comments
 (0)