serverpod-auth

Add authenticated sign-in and scope-based access control to Serverpod apps.

3.2k|369|Updated May 22, 2021
One-click install
npx skills add https://github.com/serverpod/serverpod --skill serverpod-auth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: serverpod-auth
Source: https://github.com/serverpod/serverpod/tree/main/packages/serverpod/skills/serverpod-auth
Command: npx skills add https://github.com/serverpod/serverpod --skill serverpod-auth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Serverpod Authentication helps you add reliable user sign-in, verify authenticated sessions, and enforce permissions without building auth plumbing from scratch.

Core Features & Use Cases

  • Client sign-in UX: Use the SignInWidget to integrate authentication flow into a Flutter app and react to authentication state changes.
  • Authentication state and profile access: Check isAuthenticated and fetch user profile details (such as email and full name) from the client.
  • Server-side access control: Require login and restrict endpoint access by scopes (for example, admin), and manage scopes for authenticated users.
  • Attach domain data to users: Link custom tables/models to an AuthUser to store additional per-user information.

Quick Start

Integrate SignInWidget in your Flutter UI, then set requireLogin and requiredScopes in your server endpoint to gate protected methods.

Frequently Asked Questions about serverpod-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add authentication and user sign-in to a Flutter app using Serverpod?

You can add authentication to a Flutter app using Serverpod by integrating the SignInWidget into your UI to handle the user sign-in flow and using client authentication state listeners to react to changes. This establishes the authenticated session required for backend access.

How do I restrict access to Serverpod backend endpoints based on user permissions?

You restrict access to Serverpod backend endpoints by setting requireLogin and requiredScopes in your endpoint definitions. This enforces scope-based access control, ensuring only authenticated users with specific permissions like admin can execute protected methods.

How do I check if a user is authenticated and retrieve their profile in Flutter?

You check if a user is authenticated and retrieve their profile in Flutter by using the client's isAuthenticated property and fetching user profile details such as email and full name. This allows your Flutter UI to react to the authentication state and display user-specific data.

Can I link custom domain data to an authenticated user in Serverpod?

Yes, you can link custom domain data to an authenticated user in Serverpod by attaching custom tables or models to the AuthUser. This allows you to store and manage additional per-user information beyond the standard authentication profile fields.

Do I need to build custom session management to handle Serverpod authentication?

No, you do not need to build custom session management to handle Serverpod authentication. The framework provides built-in auth session fields and client state listeners, allowing you to verify authenticated sessions and enforce permissions without building auth plumbing from scratch.