Taha
Taha
WWasp
Created by Taha on 1/9/2025 in #🙋questions
Integration of Custom Third-Party Authentication in Wasp
how to config the main.wasp file ? @kapa.ai
30 replies
WWasp
Created by Taha on 1/9/2025 in #🙋questions
Integration of Custom Third-Party Authentication in Wasp
@kapa.ai I'm implementing a custom authentication flow with Wasp. The session is successfully created (I can see it in the logs with a valid ID and expiration date), but immediately after, the GET /auth/me endpoint returns 401. Here are my logs: [Include les logs détaillés] I'm using the createSession function from 'wasp/auth/session' and returning the sessionId in the response. What could be causing this disconnect between session creation and authentication state? Is there something specific I need to do to ensure the session is properly registered with Wasp's auth system?
30 replies
WWasp
Created by Taha on 1/9/2025 in #🙋questions
Integration of Custom Third-Party Authentication in Wasp
@kapa.ai ’ve implemented the changes, but I still see this in my logs: GET /auth/me 401 2.709 ms - 43, which means the user is not authenticated, even though I’ve created a session linked to an account. What could be the issue?
30 replies
WWasp
Created by Taha on 1/9/2025 in #🙋questions
Integration of Custom Third-Party Authentication in Wasp
Thank you, that's helpful!
30 replies
WWasp
Created by Taha on 1/9/2025 in #🙋questions
Integration of Custom Third-Party Authentication in Wasp
@kapa.ai am working on integrating a custom third-party authentication system (TeamDoc) into my Wasp application. The system requires sending a combination of login and password to an external API in a specific way, along with additional parameters (hashed tokens, UUIDs, etc.). The API responds with a JSON payload containing detailed user information, including a unique user ID (userId), and other fields such as email, firstName, lastName, phoneNumber, and others. This user ID will be used to either create a new user in the Wasp database or log in an existing user. Here's what I need guidance on: Custom Authentication Flow: How can I replace or extend Wasp's default authentication system to implement this custom flow, ensuring that only this method is used for authentication (no email/password or social providers)? User Management: How do I use the userId and other fields from the JSON response to check if a user exists in Wasp's database and either log them in or create a new user? What are the best practices for syncing external user data with Wasp's database during this process? Session Management: After a successful authentication with the external API, how can I programmatically create a session for the authenticated user within Wasp? Replacing Default UI Components: Since this custom method differs from Wasp's built-in email or social authentication methods, how can I adapt or replace the default UI components to support this custom flow? Security Considerations: Are there any specific security recommendations for implementing a custom authentication system in Wasp? I’ve reviewed the documentation and understand that Wasp doesn’t natively support third-party authentication systems like this. However, I’m looking for the best approach to implement this flow seamlessly within the Wasp framework.
30 replies
WWasp
Created by Taha on 1/9/2025 in #🙋questions
Integration of Custom Third-Party Authentication in Wasp
how to config main.wasp file for this ?
30 replies