Skip to content

Conversation

@amrsa1
Copy link

@amrsa1 amrsa1 commented Nov 27, 2025

Summary:

  • Backend: Azure AD SSO implementation (Services, Controllers, Middleware).
  • Database: Schema updates for SSO users.
  • Documentation: Setup guide and Frontend implementation guide.
  • Configuration: Updated plugin arguments for Azure AD.

Amr.salem added 2 commits November 26, 2025 16:34
- Add email, authProvider, and azureAdId fields to User model
- Make password optional for SSO users
- Create Azure AD configuration service
- Create Azure AD authentication service
- Update user service to support SSO users
- Install passport, passport-azure-ad, and related dependencies
- Register SSO routes in main auth router
- Update IPluginArgs with Azure AD config
- Initialize Passport and Session in DevicePlugin
- Add Azure AD SSO setup guide
- Update README with authentication section
@amrsa1 amrsa1 changed the title Feature/azure ad sso feat: add Azure AD SSO integration Nov 27, 2025
Amr.salem added 2 commits November 27, 2025 22:04
- Update JwtPayload to include both id and userId for compatibility
- Augment Express.User type to support Prisma User model
- Update AuthenticatedRequest to properly override user property
- Add SSO fields to UserService selection queries
- Fix authorizeRoles middleware to handle optional role
- Update Passport deserializeUser to attach userId alias
@amrsa1
Copy link
Author

amrsa1 commented Nov 27, 2025

Looks like the main branch is already failing before my changes

`> appium-device-farm@11.2.6 integration-ios

mocha -r ts-node/register ./test/integration/ios/*.spec.ts --timeout 260000 --exit

Using Metadata Path: /Users/amr.salem/.cache/appium-device-farm

TSError: ⨯ Unable to compile TypeScript:
src/auth/services/user.service.ts:37:48 - error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string | Buffer'.
Type 'null' is not assignable to type 'string | Buffer'.

37 const hashedPassword = await bcrypt.hash(password, SALT_ROUNDS);
~~~~~~~~
src/auth/services/user.service.ts:44:11 - error TS2322: Type 'Promise & void' is not assignable to type 'string | null | undefined'.

44 password: hashedPassword,
~~~~~~~~

node_modules/.prisma/client/index.d.ts:16884:5
16884 password?: string | null
~~~~~~~~
The expected type comes from property 'password' which is declared here on type '(Without<UserCreateInput, UserUncheckedCreateInput> & UserUncheckedCreateInput) | (Without<...> & UserCreateInput)'
src/auth/services/user.service.ts:84:62 - error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string'.
Type 'null' is not assignable to type 'string'.

84 const isPasswordValid = await bcrypt.compare(password, user.password);
~~~~~~~~~~~~~
src/auth/services/user.service.ts:138:69 - error TS2345: Argument of type 'string | null' is not assignable to parameter of type 'string'.
Type 'null' is not assignable to type 'string'.

138 const isPasswordValid = await bcrypt.compare(currentPassword, user.password);`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant