July 2023 Summaries
7 posts from Clerk
Filter
Month:
Year:
Post Summaries
Back to Blog
Passwords remain the predominant method of authentication on most websites despite known security issues and the availability of superior alternatives. This text provides a detailed guide on building password-based authentication in a Next.js application, emphasizing the importance of using expert-built libraries and services for security. It outlines the essential components for password authentication, including frontend and backend setups, password hashing and salting using bcrypt, and database storage with Supabase. The process involves creating a Next.js application, setting up a database with Supabase, and implementing password hashing and salting to secure user passwords. It also discusses the additional security measures necessary for a production environment, such as using Row Level Security, handling password resets, and verifying email addresses. The text finally suggests using the Clerk service for a more straightforward implementation of password authentication, highlighting its ease of setup and robust security features compared to building a solution from scratch.
Jul 26, 2023
3,663 words in the original blog post.
The text discusses the limitations of traditional passwords and the growing adoption of alternative authentication methods like One-Time Passwords (OTPs), which enhance security by providing a unique, time-limited code for each login session. OTPs can serve as the main authentication factor or as an additional layer in multi-factor authentication, helping to mitigate risks associated with static passwords and reducing attack vectors such as brute-force and phishing attacks. Implementing OTPs involves several steps, including generation, delivery, user input, and verification, with different methods like time-synchronized and counter-based systems. While OTPs offer significant security benefits, they require careful implementation to avoid vulnerabilities, and best practices include secure delivery channels, time-bound validity, and rate limiting. The text also outlines how to set up an OTP system in Next.js using tools like Twilio and MongoDB, emphasizing the complexity of building a secure OTP system and recommending the use of third-party providers for more robust solutions.
Jul 24, 2023
3,552 words in the original blog post.
Branching from the Redwood tutorial, this guide provides a step-by-step approach to integrating Clerk as the authentication provider in a Redwood application, likening Clerk to a gatekeeper in a forest-themed narrative. It assumes prior knowledge of basic command line usage, Node.js, React components, and familiarity with the Redwood tutorial, as well as having a Clerk account set up. The process involves cloning an example repository, configuring environment variables, and replacing the default dbAuth authentication with Clerk by running specific commands and modifying code files. After setting up Clerk, users are instructed to restart the development server and modify a layout component to incorporate Clerk's UI components, such as SignInButton and UserButton, which facilitate user login and logout. The guide also addresses customizing user information display and offers suggestions for further exploration, including role-based access control and community engagement, all while maintaining a playful tree metaphor throughout.
Jul 23, 2023
1,102 words in the original blog post.
Hasura, a GraphQL engine, enables the creation of real-time APIs for modern app development, while Clerk assists with authentication integration via JWTs. The tutorial outlines building a full-stack Next.js app using Hasura and Clerk without backend coding, requiring familiarity with command line usage, Node.js, React, and Docker Compose. It begins with setting up a Clerk project and JWT template for Hasura, followed by cloning a starter repo and configuring the environment. The app integrates a "Cookie Clicker" component using Next.js dynamic imports and sets up a Hasura GraphQL engine to track click counts in a Postgres database. Permissions are configured for CRUD operations on a scoreboard table, and custom hooks are employed to handle GraphQL queries and mutations. The tutorial concludes with connecting components and encouraging further app development, underscoring the ease of building a complete app without backend code.
Jul 23, 2023
2,693 words in the original blog post.
Chapter 8 of the "How We Roll" series explores the concept of Sessions within Clerk's authentication framework, emphasizing its role in balancing application security and user experience. Sessions refer to the duration a user is logged into an application, and they can be customized to meet specific security needs, such as enabling multi-factor authentication or setting session lifetimes. The text explains how Sessions are linked to Clients, the devices used to access the application, and highlights the importance of managing these sessions to maintain security, especially in cases of lost or compromised devices. Clerk uses JSON Web Tokens (JWTs) to reduce the overhead of fetching session data, while ensuring that authentication remains secure and performant. The system also allows for dynamic session management, enabling user permissions and roles to be updated without additional server calls, and supports features like inactivity timeouts and remote sign-outs. Overall, the chapter illustrates how Clerk provides a robust and flexible authentication solution by handling the complexities of session management.
Jul 21, 2023
1,564 words in the original blog post.
Chapter 7 of the "How We Roll" series focuses on JWT Single Sign-On (SSO) and its integration with Backend as a Service (BaaS) providers like Firebase, Supabase, and Convex through Clerk. JWT, or JSON Web Token, acts as a cryptographically signed digital passport for users, allowing secure access to various web services by sharing a single logged-in state across multiple platforms. The chapter explains how Clerk facilitates authentication by generating custom JWTs that can be configured to meet the security requirements of different providers using templates on the Clerk Dashboard. These templates allow developers to define token lifetime, signing keys, issuer information, and custom claims, thus enabling seamless user authentication and authorization in applications that rely on BaaS. This setup allows developers to focus on building applications without handling complex backend configurations, as Clerk manages the authentication logic and integration with BaaS providers.
Jul 14, 2023
1,122 words in the original blog post.
The text provides a detailed guide on incrementally migrating a Next.js application from the Pages Router, located in the /pages directory, to the newer App Router in the /app directory. It emphasizes a page-by-page approach to transition, highlighting the creation of a Root Layout and ClientLayout, and the need to adjust data fetching methods like getStaticProps and getServerSideProps for compatibility with the App Router. This migration requires reorganizing the file structure, creating separate directories for each page, and handling data fetching and rendering separately. The guide points out that while the App Router supports both Client and Server Components, the Client Components remain unchanged, still being rendered on the server and hydrated on the client. It advises minimizing the use of "use client" to optimize the application by primarily using Server Components, resulting in reduced JavaScript sent to the client and improved performance.
Jul 03, 2023
2,194 words in the original blog post.