File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export type AadToken = {
4848 sub : string ;
4949 tid : string ;
5050 unique_name : string ;
51+ upn ?: string ;
5152 uti : string ;
5253 ver : string ;
5354 roles ?: string [ ] ;
@@ -159,7 +160,10 @@ const authPlugin: FastifyPluginAsync = async (fastify, _options) => {
159160 verifyOptions ,
160161 ) as AadToken ;
161162 request . tokenPayload = verifiedTokenData ;
162- request . username = verifiedTokenData . email || verifiedTokenData . sub ;
163+ request . username =
164+ verifiedTokenData . email ||
165+ verifiedTokenData . upn ?. replace ( "acm.illinois.edu" , "illinois.edu" ) ||
166+ verifiedTokenData . sub ;
163167 const expectedRoles = new Set ( validRoles ) ;
164168 if ( verifiedTokenData . groups ) {
165169 const groupRoles = await Promise . allSettled (
You can’t perform that action at this time.
0 commit comments