Configure Keycloak Self-Registration: Empower Your Users
APIPark is a high-performance AI gateway that allows you to securely access the most comprehensive LLM APIs globally on the APIPark platform, including OpenAI, Anthropic, Mistral, Llama2, Google Gemini, and more.Try APIPark now! πππ
Configure Keycloak Self-Registration: Empower Your Users
In the ever-evolving digital landscape, where user experience and robust security are no longer mere aspirations but fundamental requirements, the ability for users to manage their own digital identities has become paramount. Gone are the days of cumbersome manual onboarding processes, fraught with delays, administrative overhead, and potential for human error. Modern applications and services demand a seamless, intuitive, and secure gateway for new users to join. This is precisely where Keycloak's self-registration feature emerges as a powerful, transformative tool. Itβs more than just a convenience; itβs a strategic enabler, empowering users from the very first interaction and significantly streamlining an organization's identity and access management (IAM) strategy.
This comprehensive guide delves deep into the configuration, benefits, and advanced considerations of Keycloak self-registration. We will explore how this feature not only reduces the administrative burden on IT teams but also fosters a superior user experience, builds trust, and scales efficiently with your growing user base. From the foundational concepts of Keycloak to intricate theme customizations, security best practices, and integration strategies, we will equip you with the knowledge to implement a robust and user-centric self-registration system that truly empowers your users and fortifies your digital perimeter. Prepare to unlock the full potential of Keycloak, transforming your user onboarding process into a secure, self-service, and scalable operation.
Chapter 1: Understanding Keycloak and its Role in Modern Identity Management
At the heart of any secure and scalable digital ecosystem lies a robust Identity and Access Management (IAM) solution, and for many organizations, Keycloak stands as a beacon of open-source excellence in this critical domain. Before we delve into the specifics of self-registration, it's essential to grasp the foundational role Keycloak plays in orchestrating digital identities and controlling access across an array of applications and services. Keycloak is far more than just a user database; it is a full-featured IAM platform designed to alleviate the complexities associated with authentication and authorization. It provides a centralized service that applications can delegate these crucial tasks to, allowing developers to focus on core business logic rather than reinventing security primitives. This centralization not only enhances security by enforcing consistent policies but also dramatically improves the user experience through single sign-on (SSO) capabilities, where a user authenticates once and gains access to multiple connected applications without needing to re-enter credentials.
The core functionalities of Keycloak extend across a broad spectrum, addressing the multifaceted needs of modern digital environments. Beyond SSO, Keycloak proficiently handles identity brokering, enabling users to log in with existing social media accounts like Google or GitHub, or enterprise directories such as LDAP and Active Directory. This flexibility caters to diverse user populations and integrates seamlessly with existing IT infrastructure. Furthermore, Keycloak offers fine-grained authorization capabilities, allowing administrators to define precise rules about who can access what resources under specific conditions. In an era dominated by microservices architectures and distributed systems, where applications are loosely coupled and constantly evolving, Keycloak provides the critical glue that binds these disparate components together with a unified security layer. Its support for industry-standard protocols such as OpenID Connect, OAuth 2.0, and SAML 2.0 ensures broad interoperability and future-proofing, making it a versatile choice for securing everything from traditional web applications to cutting-edge APIs and mobile backends.
The necessity of a strong IAM solution like Keycloak is underscored by several undeniable truths in today's digital landscape. Firstly, security breaches are a constant threat, and weak identity management is often the weakest link. Keycloak helps fortify this link by enforcing strong authentication mechanisms, multi-factor authentication (MFA), and secure password policies. Secondly, regulatory compliance, such as GDPR, CCPA, and HIPAA, increasingly mandates stringent controls over user data and access, a requirement that Keycloak helps organizations meet through its robust auditing and access control features. Thirdly, user experience is paramount; friction in the login or registration process can lead to abandonment and lost opportunities. Keycloak streamlines these interactions, making digital life easier for users. Lastly, as organizations adopt cloud-native architectures and leverage APIs to connect services, the need for a centralized identity provider that can secure these interactions becomes indisputable. Keycloak provides the framework for securing API endpoints, managing access tokens, and ensuring that only authorized entities can interact with sensitive services.
Keycloak's architecture is thoughtfully designed around several key concepts that facilitate this comprehensive IAM strategy. The highest level of abstraction is the "Realm," which acts as a logical domain for managing users, applications, and security policies. Think of a realm as a tenancy within Keycloak, completely isolated from other realms, allowing multi-tenant deployments where each tenant has its own distinct set of users and configurations. Within a realm, "Clients" represent applications or services that are secured by Keycloak. These clients can be anything from a web application, a mobile app, to a microservice, each configured with specific access policies and client credentials. "Users" are the individuals who interact with these clients, and Keycloak stores their profiles, credentials, and authentication data. "Roles" define sets of permissions, which can be assigned to users or groups, enabling fine-grained access control. Finally, "Identity Providers" allow Keycloak to broker authentication from external systems, extending its reach beyond its internal user store. Understanding these architectural components is fundamental to effectively configuring and leveraging Keycloak, especially when it comes to empowering users through features like self-registration, which directly impacts how users are created and managed within a specific realm. This philosophical shift from tightly controlled, manually provisioned accounts to user-centric, self-managed identities is a testament to Keycloak's adaptability and its commitment to meeting the demands of modern digital interactions.
Chapter 2: The Power of Self-Registration: Benefits and Use Cases
The introduction of self-registration capabilities within an IAM platform like Keycloak represents a significant paradigm shift, moving the initial burden of user account creation from administrators to the users themselves. This seemingly simple feature unlocks a cascade of benefits, not only for the end-users seeking access to digital services but also for the organizations providing those services. It is a fundamental component of fostering user empowerment, ensuring that individuals have greater control over their digital footprint from the moment they decide to engage with an application or platform. By allowing users to create their own accounts, organizations can scale their user base more effectively, improve operational efficiency, and enhance the overall security posture through immediate user verification.
2.1 Benefits for Users
For the end-user, self-registration translates directly into an immediate and tangible improvement in their digital journey. The most obvious advantage is convenience and speed. Instead of waiting for an administrator to manually create an account or process a request, users can sign up instantly, anytime, anywhere. This immediacy is crucial in today's fast-paced digital world, where expectations for instant access are the norm. Imagine a potential customer trying to access an e-commerce platform or a developer eager to explore an API; any delay in gaining access can lead to frustration and potentially, abandonment. Self-registration removes this friction, allowing users to proceed directly to the service they intend to use.
Furthermore, self-registration fosters a sense of self-service capabilities and ownership. Users are directly responsible for providing their own information, ensuring its accuracy, and setting up their initial credentials. This empowers them to take control of their digital identity from the outset, reducing reliance on external parties for basic account management tasks. This initial empowerment often translates into a more positive overall user experience, building a stronger relationship between the user and the digital service. The reduced friction in onboarding means users spend less time navigating administrative hurdles and more time engaging with the core value of the application, leading to higher conversion rates and greater user satisfaction. They are no longer passive recipients of an account but active participants in their digital journey, setting the stage for a more engaged and loyal user base.
2.2 Benefits for Administrators/Organizations
While users reap the rewards of convenience, organizations gain a wealth of operational and strategic advantages from implementing Keycloak self-registration. Perhaps the most significant benefit for administrators is the reduced administrative burden and costs. Manual account creation is a tedious, time-consuming process that scales poorly. As user bases grow, the IT team's workload can become unsustainable, diverting valuable resources from more strategic initiatives. Self-registration offloads this repetitive task, allowing IT staff to focus on higher-value activities such as system maintenance, security enhancements, and innovation. This efficiency gain translates directly into cost savings through optimized resource allocation.
Scalability for growing user bases is another critical advantage. A system that can automatically handle new user registrations without human intervention is inherently more scalable. Whether an organization experiences a gradual increase in users or a sudden surge due to a marketing campaign or product launch, Keycloak's self-registration mechanism can seamlessly accommodate the influx. This prevents bottlenecks and ensures that the infrastructure can support growth without compromising performance or user experience. Moreover, by requiring users to input their own data during registration, organizations benefit from improved data accuracy. Users are generally more careful when entering their own personal information, leading to fewer errors compared to data entry performed by an administrator based on potentially ambiguous requests. This accuracy is vital for personalized services, communication, and compliance. Finally, self-registration contributes to a faster time-to-market for new services. When launching a new application or feature, the user onboarding process is often a critical path item. With self-registration configured, this bottleneck is eliminated, enabling organizations to deploy and scale new offerings more rapidly, accelerating innovation and responsiveness to market demands. Combined with features like immediate email verification, self-registration can also enhance security by quickly confirming the legitimacy of a user's contact information, an essential step in preventing fraudulent accounts.
2.3 Common Use Cases
The versatility of Keycloak self-registration makes it suitable for a wide array of applications and scenarios, each benefiting from its inherent efficiencies and user-centric approach.
One of the most prevalent use cases is in customer-facing applications such as e-commerce platforms, Software-as-a-Service (SaaS) products, and online banking portals. In these environments, providing an effortless and secure registration path is crucial for customer acquisition and retention. A potential customer who finds the sign-up process too complex or time-consuming is likely to abandon it, taking their business elsewhere. Self-registration ensures a smooth entry point, converting visitors into registered users with minimal friction.
Community portals and forums also heavily leverage self-registration. These platforms thrive on user participation, and a straightforward sign-up process encourages new members to join, contribute, and engage. Whether it's a fan forum, a support community, or a professional networking site, easy access through self-registration is key to building a vibrant and active user base.
Another significant application is in developer portals. These platforms provide developers with access to APIs, SDKs, and documentation, enabling them to build integrations and extend the functionality of various services. For example, a platform like APIPark, an open-source AI gateway and API management platform, could benefit immensely from Keycloak self-registration. APIPark, designed to help developers manage, integrate, and deploy AI and REST services with ease, requires a robust identity solution for its API consumers. By integrating Keycloak's self-registration, APIPark could empower developers to quickly create accounts, subscribe to APIs, manage their API keys, and access relevant documentation, all within a secure and streamlined environment. This not only simplifies the onboarding of developers to the APIPark platform but also ensures that API access is controlled and audited effectively. The ability for developers to register and immediately start exploring APIPark's capabilities, such as integrating 100+ AI models or encapsulating prompts into REST APIs, significantly enhances the developer experience and accelerates innovation.
Finally, while often associated with external users, self-registration can also be adapted for certain internal applications, particularly in larger organizations with frequently changing contractor or temporary employee bases. With proper administrative approval workflows and security controls in place (which we will discuss in later chapters), self-registration can reduce the overhead of provisioning accounts for non-permanent staff, allowing them to gain necessary access quickly while maintaining strict oversight. In essence, any application or service that requires a user account to function and aims to minimize administrative overhead while maximizing user autonomy is a prime candidate for implementing Keycloak self-registration.
Chapter 3: Deep Dive into Keycloak Self-Registration Configuration
Configuring self-registration in Keycloak involves a series of steps, from simply enabling the feature to meticulously customizing the user experience and securing the registration process. This chapter will guide you through the technical intricacies, ensuring that you can implement a robust, branded, and secure self-registration flow tailored to your organization's needs. The journey begins with the fundamental prerequisites and extends to the sophisticated customization of forms, workflows, and security policies.
3.1 Prerequisites
Before embarking on the configuration journey, ensure you have the following in place:
- A running Keycloak instance: This could be a local development setup, a containerized deployment, or a cluster in a production environment.
- Administrative access to Keycloak: You will need an administrator account with permissions to manage realms, clients, and themes. Typically, this means access to the Keycloak Admin Console.
- Basic understanding of Keycloak concepts: Familiarity with Realms, Clients, Users, and Roles, as discussed in Chapter 1, will be beneficial.
- Email server configuration (highly recommended): For features like email verification and password resets, Keycloak needs to be configured with an SMTP server. Without this, crucial post-registration steps, which are vital for security and user experience, will not function correctly. Navigate to
Realm Settings -> Emailto configure this, providing your SMTP host, port, credentials, and security settings (SSL/TLS).
3.2 Enabling Self-Registration
The foundational step to activate self-registration is straightforward and can be accomplished within the Keycloak Admin Console.
- Navigate to Realm Settings: After logging into the Admin Console, select the specific realm for which you want to enable self-registration from the realm dropdown in the top-left corner. Then, click on "Realm Settings" in the left-hand navigation menu.
- Access the Login Tab: Within the Realm Settings, navigate to the "Login" tab. This tab contains various configurations related to user authentication flows, including registration.
- Toggle "User registration" to ON: Locate the "User registration" switch and ensure it is enabled. Once this is set to ON, a "Register" link will appear on your Keycloak login page, allowing users to initiate the self-registration process.
- Explore Related Settings: While here, it's prudent to review other critical settings that directly impact the registration and login experience:
- Forgot password: Enable this to allow users to reset their passwords if forgotten. This is almost always a necessity for any public-facing application.
- Remember Me: Provides a persistent session for users, enhancing convenience.
- Verify Email: Crucially, ensure this is set to ON. Email verification is a fundamental security measure for self-registration, confirming that the user owns the email address they provided and preventing the creation of spam or fraudulent accounts. Keycloak will send a verification link to the user's registered email address, and their account will remain disabled or restricted until verified.
- Login with email: Allows users to log in using their email address instead of a username. This can simplify the login experience for many users.
- Duplicate emails: Determines whether multiple users can share the same email address within the realm. For most self-registration scenarios, it's best to keep this OFF to ensure email uniqueness, especially when using email for login or recovery.
After making these adjustments, remember to click "Save" to apply the changes to your realm. At this point, new users will be able to access a basic registration form via the "Register" link on your Keycloak login page.
3.3 Customizing the Registration Form
While the default Keycloak registration form is functional, most organizations require a branded experience and the ability to collect specific user information. Keycloak offers powerful mechanisms for customization, primarily through its theming system and user profile SPI.
3.3.1 Keycloak Themes
Keycloak's look and feel are managed through themes. Every realm can have its own set of themes for the login page, account management console, admin console, and email templates.
- Understanding Theme Structure:
- Keycloak uses themes to separate presentation logic from core functionality. Themes are organized in a directory structure, typically under
KEYCLOAK_HOME/themes. - The
basetheme provides the core structure and resources, while thekeycloaktheme builds uponbaseto provide a default look. - To customize, you should never modify the
baseorkeycloakthemes directly. Instead, create a custom theme that extends an existing one.
- Keycloak uses themes to separate presentation logic from core functionality. Themes are organized in a directory structure, typically under
- Creating a Custom Theme:
- Create a new directory under
KEYCLOAK_HOME/themes, for example,my_custom_theme. - Inside
my_custom_theme, create alogindirectory (for customizing the login page, which includes registration). - Within the
logindirectory, create atheme.propertiesfile. This file specifies the parent theme and resources. For example:properties parent=keycloak styles=css/custom.css scripts=js/custom.js - Create
cssandjssubdirectories withinloginfor your custom stylesheets and JavaScript files. - To modify the registration form, you'll primarily be interested in the FreeMarker Template Language (FTL) files. Copy the
register.ftlandlogin.ftl(if you want to customize the login page as well) fromKEYCLOAK_HOME/themes/keycloak/login/into yourmy_custom_theme/login/directory.
- Create a new directory under
- Modifying
register.ftlfor Form Fields:- Open
my_custom_theme/login/register.ftl. This file renders the self-registration form. - You can add or remove fields, rearrange their order, or change their labels. For example, to add a new text input field for a custom user attribute (e.g., "Company Name"), you might add something like this:
html <div class="${properties.kcFormGroupClass!}"> <div class="${properties.kcLabelWrapperClass!}"> <label for="user.attributes.companyName" class="${properties.kcLabelClass!}">Company Name</label> </div> <div class="${properties.kcInputWrapperClass!}"> <input type="text" id="user.attributes.companyName" class="${properties.kcInputClass!}" name="user.attributes.companyName" value="${(register.formData.attributes.companyName!'')}" /> </div> </div> - The
name="user.attributes.companyName"convention is crucial for Keycloak to recognize and store this as a user attribute. - Remember to apply your custom theme in
Realm Settings -> Themes -> Login Themedropdown.
- Open
3.3.2 Required Actions
Required actions are tasks users must complete after logging in, or in this context, after registration, to fully activate their account or fulfill certain requirements.
- Email Verification: As mentioned, this is paramount. When
Verify Emailis enabled in Realm Settings, Keycloak automatically adds "Verify Email" as a required action. The user will be prompted to verify their email before they can access applications. - Update Profile: If you enable "Update Profile" as a required action, users might be redirected to their account management page to complete additional profile details (though for self-registration, they typically fill in fields on the
register.ftldirectly). - Terms and Conditions: For compliance, you can implement a "Terms and Conditions" required action. Keycloak provides a built-in one where you can upload an HTML file containing your terms, and users must accept them upon first login. This is a common requirement during self-registration flows.
- Configure OTP: If you mandate multi-factor authentication (MFA), "Configure OTP" (One-Time Password) can be set as a required action, forcing users to set up an authenticator application or security key.
Required actions are configured under Realm Settings -> Required Actions. You can mark them as "Default Action" to apply them to all new users or specific flows.
3.3.3 Validators and Policies
To ensure data integrity and security, Keycloak allows you to enforce policies on user inputs during registration.
- Password Policy Configuration: Under
Realm Settings -> Security Defenses -> Password Policy, you can define stringent rules for user passwords. This includes:- Minimum length.
- Required characters (digits, lowercase, uppercase, special characters).
- Not username.
- Password history (preventing reuse of previous passwords).
- You can set a default policy that applies to all users upon registration and subsequent password changes.
- User Profile Validators: For Keycloak versions 17 and above, the User Profile SPI (Service Provider Interface) provides a powerful way to define and validate user attributes, including those collected during self-registration.
- Navigate to
Realm Settings -> User Profile. Here you can define attributes (e.g.,companyName), specify their types, whether they are required, and add custom validators (e.g., regex patterns, unique constraints). - For example, you can mark the
emailattribute as read-only for users but editable for administrators, and add a unique validator to prevent duplicate emails across the realm. - Prior to Keycloak 17, custom attribute validation often required custom SPI development. The User Profile SPI simplifies this significantly.
- Navigate to
3.4 Post-Registration Workflows and Security
Enabling self-registration is only the first step. Securing the process and integrating it into broader identity management workflows is crucial.
3.4.1 Email Verification
As highlighted, email verification is a cornerstone of secure self-registration. * When "Verify Email" is enabled, Keycloak sends an email with a unique verification link. * The email template for verification can be customized under Realm Settings -> Email. Look for the email-verification.ftl template in your theme's email directory to brand it and tailor its message. * Users' accounts are typically in a "pending verification" state until they click the link, preventing them from logging in or accessing resources. This effectively mitigates bot registrations and ensures legitimate contact information.
3.4.2 User Groups and Roles
Automatically assigning new users to specific groups or roles upon registration can streamline their initial access and permissions. * While Keycloak doesn't have a direct "assign default group on registration" setting in the UI, this can be achieved via a custom User Federation provider (SPI) or a custom event listener that triggers after a successful registration event. * Alternatively, for simpler scenarios, you might implement an approval flow (see next point) where an administrator manually assigns groups/roles. * Client roles can also be automatically assigned if the client itself defines specific default roles for new users upon first login, or via protocol mappers that add roles to tokens based on user attributes or group memberships.
3.4.3 Administrator Approval (Optional, but important for some use cases)
For scenarios requiring stricter control, such as internal applications or sensitive external services, you might want an administrator to review and approve new self-registered accounts before they become active. * Keycloak does not provide an out-of-the-box UI for admin approval of self-registered accounts. This typically requires a custom Keycloak extension (SPI). * A common approach involves: 1. Creating a custom EventListenerProvider that listens for REGISTER events. 2. When a user registers, this listener marks the user's account as "disabled" or adds a custom attribute like status: pending_approval. 3. It then triggers a notification to an administrator (e.g., sends an email or posts to a workflow system). 4. An administrator uses a custom tool or a custom Keycloak Admin Console extension to review pending accounts and enable them (or modify the status attribute) when approved. * Trade-offs: While enhancing security and control, introducing an approval step adds friction to the user experience and reintroduces administrative overhead, albeit a controlled one. Weigh these trade-offs carefully based on your application's security requirements.
3.4.4 Integration with Identity Providers
Keycloak excels at identity brokering, allowing users to register and log in using existing accounts from other identity providers (IDPs). * Social Login: Integrate with popular social IDPs like Google, GitHub, Facebook, Twitter, etc., under Realm Settings -> Identity Providers. * Enterprise IDPs: Connect to corporate directories or other SAML/OpenID Connect providers. * Users can then choose to "Register with Google" instead of filling out the form. Keycloak handles the federation, optionally creating a local user account for the external identity. This can significantly simplify the registration process for users, leveraging trust from established providers.
Table 3.1: Keycloak Self-Registration Configuration Checklist
| Configuration Area | Key Settings/Actions | Rationale | Location in Admin Console |
|---|---|---|---|
| Enablement | Toggle "User registration" ON | Allow users to create accounts. | Realm Settings > Login |
| Toggle "Forgot password" ON | Provide account recovery option. | Realm Settings > Login | |
| Toggle "Verify Email" ON | Securely verify user's email, prevent spam. | Realm Settings > Login | |
| Email Configuration | Configure SMTP server details | Enable email verification, password reset emails. | Realm Settings > Email |
| Theme Customization | Create custom login theme, extend keycloak |
Brand registration page, tailor look and feel. | KEYCLOAK_HOME/themes/my_custom_theme/login |
Modify register.ftl |
Add/remove form fields, change labels, layout. | my_custom_theme/login/register.ftl |
|
| User Profile/Attributes | Define custom attributes via User Profile SPI (KC17+) | Collect additional user data during registration. | Realm Settings > User Profile |
| Configure required status, validators for attributes | Enforce data integrity and requirements for collected user data. | Realm Settings > User Profile | |
| Password Policy | Set minimum length, character requirements, history | Enforce strong passwords for enhanced security. | Realm Settings > Security Defenses > Password Policy |
| Required Actions | Enable "Terms and Conditions" (if needed) | Ensure user agreement to legal terms. | Realm Settings > Required Actions |
| Identity Brokering | Configure social/enterprise Identity Providers | Offer alternative, simplified registration via external IDPs. | Realm Settings > Identity Providers |
| Admin Approval | Requires custom SPI development | Implement manual review for sensitive applications (optional). | N/A (Custom Code) |
| Bot Protection | Requires custom theme/SPI for CAPTCHA/reCAPTCHA | Prevent automated registrations and spam accounts (optional, advanced). | N/A (Custom Code) |
Chapter 4: Advanced Customization and Best Practices for Self-Registration
Moving beyond the basic enablement, truly effective Keycloak self-registration involves meticulous customization and adherence to best practices that enhance security, usability, and compliance. This chapter delves into advanced techniques for tailoring the registration experience, protecting against malicious activity, and ensuring a smooth journey for every new user. From extending user profiles to implementing robust bot protection, these strategies are critical for a mature and resilient identity management system.
4.1 Extending User Profiles with Custom Attributes
In many real-world scenarios, the default user attributes (username, email, first name, last name) provided by Keycloak are insufficient. Organizations often need to collect additional information during registration, such as company name, department, phone number, or custom identifiers. Keycloak, particularly from version 17 onwards, provides a powerful and streamlined way to define and manage these custom attributes through its User Profile Service Provider Interface (SPI).
- Defining Custom Attributes:
- Navigate to
Realm Settings -> User Profilein the Keycloak Admin Console. - Here, you can define "Attribute Groups" for organizational purposes and then add individual "Attributes".
- For each attribute, you can specify its name (which corresponds to
user.attributes.<attributeName>inregister.ftl), its display name, and a description. - Crucially, you can define configurations for each attribute:
- Annotations: Key-value pairs that provide metadata for attributes, used for validation or rendering hints.
- Validators: Built-in validators like
email,maxLength,options(for dropdowns),pattern(regex),personName,unique. You can chain multiple validators. - Permissions: Define who can view (
view) or edit (edit) the attribute. This is powerful: you can make an attribute editable by the user during registration but then read-only in their account management, or only editable by administrators. Roles can also be specified for these permissions. - Required: Mark an attribute as required for specific contexts (e.g.,
registration). - GUI Editor for
register.ftl(Keycloak 18+): Newer versions offer a "Form" tab within the User Profile settings, allowing you to visually add and arrange fields for the registration form, significantly simplifying the process compared to directly editingregister.ftl. This generates the necessaryregister.ftlsnippets for you.
- Navigate to
- Mapping to the Registration Form (
register.ftl):- Once attributes are defined in the User Profile SPI, you can reference them in your custom
register.ftltemplate. As shown in Chapter 3.3.1, usingname="user.attributes.yourAttributeName"ensures Keycloak captures the data. - The User Profile SPI handles the storage and validation of these attributes, making the
register.ftlprimarily a presentation layer.
- Once attributes are defined in the User Profile SPI, you can reference them in your custom
- Using Client Scopes to Expose/Manage Attributes:
- After registration, these custom attributes are stored in the user's profile. Applications need to access this data.
- Keycloak uses "Client Scopes" and "Mappers" to include user attributes in access tokens and ID tokens.
- Go to
Clients -> [Your Client] -> Client Scopes. Add or configure existing client scopes (e.g.,profilescope) and use "Mappers" to map user attributes to claims in the tokens. For example, aUser Attributemapper can takeuser.attributes.companyNameand map it to acompany_nameclaim in the ID token. This ensures your applications receive the necessary user data upon successful authentication.
4.2 Customizing Email Templates
Email communication is a vital part of the self-registration workflow, particularly for verification, but also for password resets and other notifications. Branding these emails reinforces trust and provides a consistent user experience.
- Localization: Keycloak supports internationalization for email templates. Create subdirectories within your theme's
emaildirectory for different languages (e.g.,email/en,email/fr). - Branding: Copy the default email templates (e.g.,
email-verification.ftl,password-reset.ftl) from thekeycloaktheme'semaildirectory into your custom theme'semaildirectory. You can then:- Add your company logo.
- Customize the header, footer, and body text to match your brand's tone and style.
- Include links to your support portal or privacy policy.
- Use FreeMarker syntax to dynamically inject user details or links provided by Keycloak (e.g.,
${user.firstName},${link.verifyEmail}).
- Types of Templates: Focus on customizing the templates most relevant to self-registration and account recovery:
email-verification.ftl: For confirming new registrations.password-reset.ftl: For forgotten password requests.execute-actions.ftl: For emails related to required actions.
4.3 Internationalization (i18n) and Localization (l10n)
To serve a global user base, your self-registration pages must be accessible in multiple languages. Keycloak provides robust support for internationalization.
- Translating Registration Forms and Messages:
- Keycloak messages are defined in properties files within your theme. For the login theme, this is typically
messages/messages_en.properties,messages_fr.properties, etc. - Copy these files from the
keycloaktheme into your custom theme'smessagesdirectory. - Edit these files to provide custom translations for labels, error messages, and form field hints.
- You can also add new keys for messages specific to your custom fields.
- Keycloak messages are defined in properties files within your theme. For the login theme, this is typically
- Configuring Supported Locales:
- In
Realm Settings -> Localization, you can specify the "Supported Locales" for your realm. This will allow users to select their preferred language from a dropdown on the login/registration page, assuming your theme supports it. - The
messages.propertiesfile acts as the default if a specific locale file is not found.
- In
4.4 Security Considerations for Self-Registration
While self-registration offers immense benefits, it also opens a potential attack vector if not properly secured. Robust security measures are paramount to prevent abuse, such as bot registrations, spam, and credential stuffing.
- Bot Protection (CAPTCHA/reCAPTCHA Integration):
- This is one of the most critical defenses against automated account creation. Keycloak does not have a built-in UI setting for CAPTCHA on the registration form.
- Implementing CAPTCHA (e.g., Google reCAPTCHA) usually requires custom theme development. You would need to:
- Add the reCAPTCHA script to your
register.ftlfile. - Include the reCAPTCHA widget on the form.
- Implement a custom
EventListenerProvideror aFormAuthenticatorSPI that intercepts the registration request. - In the SPI, verify the reCAPTCHA token with the reCAPTCHA API before allowing the registration to proceed. If verification fails, the registration is rejected.
- Add the reCAPTCHA script to your
- Rate Limiting for Registration Attempts:
- While Keycloak doesn't offer granular UI-based rate limiting specifically for the registration endpoint, general server-level rate limiting (e.g., using a reverse proxy like Nginx or a WAF) can protect against brute-force registration attempts from a single IP address.
- For more fine-grained control, a custom Keycloak SPI can inspect the frequency of registration attempts from an IP or a specific parameter and temporarily block suspicious sources.
- Strong Password Policies:
- As discussed in Chapter 3, always enforce a strong password policy (minimum length, complexity, history) to ensure users create secure passwords from the outset. This significantly reduces the risk of dictionary attacks and credential stuffing.
- Account Lockout Policies:
- Configure account lockout for failed login attempts (
Realm Settings -> Security Defenses -> Brute Force Detection). While primarily for login, this discourages attackers who might try to use registered (or self-registered) accounts.
- Configure account lockout for failed login attempts (
- Monitoring Registration Events:
- Keycloak emits events for various actions, including
REGISTER. Configure an event listener (Keycloak's built-in database listener or a custom one that pushes to a SIEM/logging system) to monitor all registration events. - Look for anomalies: a sudden spike in registrations, registrations from unusual IP ranges, or rapid successive registrations from the same source. This proactive monitoring helps identify and respond to potential abuse quickly.
- Keycloak emits events for various actions, including
- Protection Against Spam Accounts:
- Beyond CAPTCHA, consider other methods:
- Email Domain Blacklisting: If certain email domains are consistently used for spam, a custom SPI can block registrations from those domains.
- Honeypot Fields: Add a hidden form field to
register.ftlthat legitimate users won't fill, but bots often will. If the field is populated, reject the registration.
- Beyond CAPTCHA, consider other methods:
4.5 User Experience (UX) Best Practices
A secure registration process should not come at the cost of a poor user experience. Good UX encourages completion and reduces frustration.
- Clear, Concise Error Messages:
- When validation fails (e.g., invalid email, password not meeting policy), provide clear, actionable error messages that guide the user on how to correct the issue. Avoid generic error messages. These messages are defined in your theme's
messages.propertiesfiles.
- When validation fails (e.g., invalid email, password not meeting policy), provide clear, actionable error messages that guide the user on how to correct the issue. Avoid generic error messages. These messages are defined in your theme's
- Minimal Required Fields:
- Only ask for the absolute minimum information required for initial registration. You can always collect more details post-login or progressively. Too many fields lead to abandonment.
- Progress Indicators:
- If your registration involves multiple steps (e.g., form -> email verification -> required actions), provide clear visual indicators of progress to reduce user anxiety.
- Mobile Responsiveness:
- Ensure your custom theme's registration page is fully responsive and provides an excellent experience on various devices, from desktops to smartphones. Most modern web traffic originates from mobile devices.
- Providing Help and Support Links:
- Include links to your privacy policy, terms of service, and a help/support page directly on the registration form. This builds trust and provides assistance if users encounter issues.
- Streamlining the Journey from Registration to First Login:
- Once registered and verified, ensure the user is automatically logged in or clearly directed to the login page. The transition should be seamless. Consider a "welcome" message or a guided tour for first-time users to help them get started with your application. Avoid making them jump through too many hoops immediately after registration.
Chapter 5: Integrating Keycloak Self-Registration with Applications
Once Keycloak self-registration is configured, the next crucial step is to integrate it seamlessly with your applications. This involves understanding how your applications delegate authentication to Keycloak and how they consume the identity information provided by Keycloak after a successful registration and login. Keycloak's adherence to industry-standard protocols makes this integration flexible and robust, supporting a wide range of application architectures from traditional web applications to modern microservices.
5.1 Overview of Keycloak Client Adapters
Keycloak simplifies the integration process for various application types by providing "client adapters." These are libraries or SDKs that abstract away the complexities of OAuth 2.0 and OpenID Connect protocols, allowing developers to integrate with Keycloak with minimal code.
- Different Types: Keycloak offers adapters for popular programming languages and frameworks, including:
- Java Adapters: For applications built with Spring Boot, WildFly, EAP, Tomcat, etc. These adapters handle token validation, session management, and secure redirection.
- JavaScript Adapter: A client-side library for single-page applications (SPAs) that facilitates authentication flows directly from the browser.
- Node.js Adapter: For Node.js-based backend services.
- Generic HTTP Adapters: For applications that don't have a specific adapter, developers can manually implement the OAuth 2.0/OpenID Connect flows.
- Simplifying Integration: These adapters automatically handle:
- Redirection to Keycloak: When an unauthenticated user tries to access a protected resource, the adapter redirects them to the Keycloak login/registration page.
- Token Exchange: After successful authentication (or registration), the adapter exchanges the authorization code for access tokens, ID tokens, and refresh tokens.
- Token Validation: Validates the received tokens to ensure their authenticity and integrity.
- Session Management: Establishes and manages the application's session, potentially including single sign-out (SLO).
By using an adapter, developers can quickly enable secure authentication and leverage the self-registration feature without delving deeply into the underlying protocol mechanics.
5.2 OAuth 2.0 and OpenID Connect Flows
Keycloak's integration relies heavily on OAuth 2.0 for authorization and OpenID Connect (OIDC) for authentication. Understanding these flows is crucial, especially when an adapter isn't available or for custom integrations.
- Authorization Code Flow (for Web Applications): This is the most recommended and secure flow for confidential clients (applications that can securely store a client secret, like traditional web applications).
- User clicks "Login" or "Register" on the application.
- Application redirects the user's browser to Keycloak's authorization endpoint.
- User interacts with Keycloak (logs in, registers, verifies email, etc.).
- Keycloak redirects the user back to the application with an authorization code.
- The application, using its client ID and client secret, exchanges this authorization code for an ID token, access token, and refresh token directly with Keycloak's token endpoint (backend-to-backend communication).
- The application validates the tokens and establishes a secure session for the user.
- Implicit Flow (Less Recommended for Modern SPAs): Historically used for SPAs, but now largely superseded by Authorization Code Flow with PKCE (Proof Key for Code Exchange) due to better security. In the Implicit Flow, tokens are directly returned to the browser in the redirect URL, making them vulnerable to interception.
- Client Credentials Flow (for Machine-to-Machine): This flow is used when a machine or service needs to authenticate with Keycloak to access resources, without an end-user present. It's not directly related to user self-registration but is part of the broader Keycloak ecosystem for securing service-to-service communication, e.g., an APIPark backend service securely interacting with other services after a developer registers.
- Role of Scopes and Claims:
- Scopes: Applications request specific "scopes" during the authentication process (e.g.,
openid,profile,email). These scopes define the level of access the application needs to the user's information.openidis mandatory for OIDC. - Claims: After authentication, Keycloak issues tokens (ID token, access token) that contain "claims" β pieces of information about the user (e.g.,
subfor subject ID,name,email, custom attributes mapped from the user profile). Applications read these claims to identify the user and retrieve necessary profile data, including any custom attributes collected during self-registration.
- Scopes: Applications request specific "scopes" during the authentication process (e.g.,
5.3 Example Flow: Web Application Integration (Conceptual)
Let's illustrate a typical integration of Keycloak self-registration with a generic web application using the Authorization Code Flow:
- User Accesses Application: A new user navigates to your web application (e.g.,
mywebapp.com). - Initiates Registration: The user clicks a "Sign Up" or "Register" button on your application's public page.
- Redirection to Keycloak: Your application's security mechanism (e.g., Keycloak client adapter or manual redirect) sends the user's browser to the Keycloak registration page (
/auth/realms/your_realm/protocol/openid-connect/auth?response_type=code&client_id=your_client_id&redirect_uri=your_app_callback_url&scope=openid profile email). - User Completes Self-Registration:
- The user fills out the custom registration form (from your
register.ftl). - Keycloak processes the form, validates input, and creates the user account in the realm.
- If email verification is enabled, Keycloak sends a verification email. The user must click the link in the email.
- Once registered and verified (if applicable), Keycloak redirects the user's browser back to the
redirect_uriprovided by your application, along with an authorizationcode.
- The user fills out the custom registration form (from your
- Application Exchanges Code for Tokens: Your web application's backend receives the authorization
code. It then makes a server-side request to Keycloak's token endpoint (/auth/realms/your_realm/protocol/openid-connect/token), sending thecode, itsclient_id, andclient_secret. - Keycloak Issues Tokens: Keycloak validates the request and, if successful, issues an ID token, access token, and refresh token to your application.
- Application Logs User In: Your application validates the tokens (especially the ID token's signature and expiration) and extracts user information (claims). It then establishes a local session for the user and logs them into the application.
- Handling User Attributes and Roles: The claims in the ID token (and potentially by calling Keycloak's
userinfoendpoint with the access token) provide all the necessary user data, including custom attributes collected during registration and any assigned roles. Your application can use this information to personalize the user experience, enforce access control, and manage user data within its own context.
5.4 Considerations for Microservices Architecture
In a microservices environment, Keycloak acts as a central identity provider that secures interactions across multiple, independently deployed services.
- Centralized Identity: Keycloak provides a single source of truth for user identities, even across dozens or hundreds of microservices. This prevents identity silos and simplifies user management, especially after self-registration.
- API Security for Downstream Services: When a user logs in via Keycloak, the client application receives an access token. This access token is then passed to downstream microservices to authorize API calls. Microservices can:
- Introspect the token: Call Keycloak's token introspection endpoint to verify the token's validity and retrieve its claims.
- Validate locally: Use a Keycloak client adapter or library (e.g.,
keycloak-connectfor Node.js) to validate the token's signature and expiration locally, reducing round trips to Keycloak. - The claims within the token, including
sub, roles, and custom attributes, allow each microservice to make fine-grained authorization decisions.
- Leveraging Keycloak's Token Introspection and User Info Endpoint:
- For services that need more detailed, up-to-date user information than what's in the access token, they can use the
userinfoendpoint or introspection endpoint. This is particularly useful if user attributes can change post-registration, and services need the latest data without requiring a full re-login. This mechanism ensures that even services consuming APIs via a platform like APIPark can securely verify the identity and permissions of the calling user or application, leveraging Keycloak's centralized identity management. APIPark, as an API gateway, sits at the forefront of securing and managing access to diverse services, including those powered by AI models. A robust identity provider like Keycloak, with its self-registration and strong authentication features, is therefore a natural complement for securing the API consumers and developers who interact with APIPark, ensuring that only authorized users can access and utilize the integrated AI and REST services.
- For services that need more detailed, up-to-date user information than what's in the access token, they can use the
Chapter 6: Monitoring, Auditing, and Maintenance of Self-Registration
Implementing Keycloak self-registration is not a "set it and forget it" task. To ensure the long-term security, reliability, and compliance of your identity management system, continuous monitoring, thorough auditing, and diligent maintenance are essential. This chapter outlines the practices necessary to keep your self-registration process robust, secure, and performant, addressing both operational efficiency and potential security vulnerabilities.
6.1 Keycloak Event Logs
Keycloak provides a comprehensive event logging mechanism that is indispensable for monitoring user activities, including registrations. These events offer granular insights into what's happening within your realm, serving as a critical first line of defense and diagnostic tool.
- Tracking Registration Events: Keycloak emits a
REGISTERevent upon successful user self-registration. This event contains details such as the user ID, realm ID, IP address, and client ID from which the registration originated. - Monitoring Login Failures and Password Changes: Beyond registration, closely monitor
LOGIN_ERROR,LOGOUT,UPDATE_PASSWORD, andRESET_PASSWORDevents. A sudden increase in login failures from a specific IP could indicate a brute-force attack, while numerous password resets might signal account compromise attempts. - Configuring Event Listeners:
- Built-in Database Listener: Keycloak can persist events to its configured database. You can view these events in the Admin Console under
Realm Settings -> Events -> Event History. This is useful for immediate review but might not be scalable for high-volume production systems. - External SIEM/Logging Systems: For enterprise deployments, it's highly recommended to configure Keycloak to push events to an external Security Information and Event Management (SIEM) system or a centralized logging platform (e.g., ELK Stack, Splunk, DataDog). This typically involves:
- Developing a custom Keycloak
EventListenerProviderSPI that formats events (e.g., into JSON) and sends them to a message queue (Kafka, RabbitMQ) or directly to a log aggregator (Logstash, Fluentd). - These external systems can then perform advanced correlation, alerting, and long-term storage of event data, allowing for deeper security analysis and compliance reporting.
- Developing a custom Keycloak
- Proactive alerting on unusual registration patterns (e.g., 100+ registrations from a single IP within an hour) is a powerful way to detect and mitigate bot attacks or fraudulent activities early.
- Built-in Database Listener: Keycloak can persist events to its configured database. You can view these events in the Admin Console under
6.2 User Management in Keycloak Admin Console
The Keycloak Admin Console remains the primary interface for managing individual user accounts that have been created through self-registration. Administrators play a vital role in overseeing and, when necessary, intervening in the lifecycle of these accounts.
- Viewing Registered Users: Navigate to
Usersin the left-hand menu. Here, you can search for and view details of all registered users, including those who self-registered. This allows administrators to quickly access user profiles, inspect attributes, and verify registration details. - Manual Approval/Disabling of Accounts: If you have implemented a custom administrative approval workflow (as discussed in Chapter 3.4.3), administrators would use this interface (or a custom tool that interacts with Keycloak's Admin REST API) to enable or disable accounts based on their review. Even without a formal approval workflow, administrators might need to manually disable accounts found to be fraudulent or associated with malicious activity.
- Password Resets, Attribute Updates: Administrators can perform critical account management tasks for users, such as initiating password resets (if users are unable to use the self-service option), updating user attributes, managing group memberships, and revoking sessions. This provides a crucial fallback and intervention capability.
- Auditing User Actions: The
User Sessionstab provides insights into active sessions for a user, whileConsentsshows what applications the user has granted access to. These features help in auditing user activity and managing their digital footprint.
6.3 Performance and Scalability
A self-registration system must be able to handle varying loads, from a trickle of new users to sudden spikes. Performance and scalability are key to ensuring a consistent and reliable user experience.
- Database Considerations: Keycloak relies heavily on its underlying database for storing user data, realm configurations, and events.
- Ensure your database is properly sized, optimized, and configured for high availability (e.g., replication, clustering).
- Monitor database performance metrics (CPU, memory, I/O, query times) to identify bottlenecks.
- Choose a robust database solution (e.g., PostgreSQL, MySQL with appropriate tuning) that can scale with your user base.
- Clustering Keycloak for High Availability: For production environments, running a single Keycloak instance is a single point of failure. Deploy Keycloak in a cluster configuration across multiple nodes.
- This provides redundancy, ensuring that the self-registration service remains available even if one node fails.
- It also allows for load balancing, distributing incoming registration and authentication requests across multiple instances, thus improving throughput and responsiveness.
- Proper cache configuration (e.g., Infinispan distributed caches) is crucial for performance and consistency in a clustered setup.
- Load Testing Self-Registration Endpoints: Before deploying to production, conduct thorough load testing of your Keycloak self-registration and authentication endpoints.
- Simulate a high volume of concurrent registration requests to understand the system's capacity limits.
- Identify potential performance bottlenecks (e.g., database, network, Keycloak server resources).
- Adjust server resources, database tuning, or Keycloak configurations based on testing results to meet your expected user load.
6.4 Regular Security Audits
Beyond automated monitoring, periodic manual security audits are vital to identify and remediate potential vulnerabilities in your self-registration process.
- Reviewing Configuration Changes: Regularly review all changes made to realm settings, client configurations, and especially theme files that impact the registration form. Unauthorized or misconfigured changes can introduce security flaws.
- Checking for Suspicious Activity: Analyze event logs for patterns that might indicate malicious activity, even if automated alerts aren't triggered. This includes:
- Unusual geographic origins of registrations.
- Repeated attempts to register with disposable email addresses.
- Spikes in failed login attempts for specific accounts.
- Keeping Keycloak Updated: Keycloak is an actively developed open-source project, with new versions frequently released that include security patches, bug fixes, and new features.
- Establish a clear upgrade strategy and apply updates regularly. This is one of the most effective ways to protect against known vulnerabilities.
- Before upgrading, always review the release notes for breaking changes and test thoroughly in a staging environment.
- Reviewing Custom SPIs and Theme Code: If you've developed custom Keycloak SPIs or significantly altered theme code for features like CAPTCHA or custom workflows, ensure this code is regularly audited for security vulnerabilities (e.g., injection flaws, insecure data handling).
By diligently applying these monitoring, auditing, and maintenance practices, organizations can ensure that their Keycloak self-registration system remains a secure, efficient, and empowering gateway for their users, adapting to new challenges and evolving security landscapes over time. It transforms self-registration from a mere feature into a cornerstone of a robust, user-centric identity management strategy.
Conclusion
The journey through configuring Keycloak self-registration reveals a powerful truth: empowering users with the ability to manage their own digital identities is not just a convenience, but a strategic imperative in today's interconnected world. We have traversed the foundational aspects of Keycloak, understanding its pivotal role as an open-source Identity and Access Management solution, orchestrating authentication and authorization across diverse applications. From its core functionalities like SSO and identity brokering to its architectural elements of realms, clients, and users, Keycloak provides the robust backbone for modern digital ecosystems.
The profound benefits of self-registration, for both the user and the organization, cannot be overstated. For users, it means unparalleled convenience, immediate access, and a sense of ownership over their digital presence, significantly reducing friction in their initial engagement with services. For organizations, the advantages are equally compelling: a dramatic reduction in administrative overhead, enhanced scalability to accommodate growing user bases, improved data accuracy, and a faster time-to-market for new digital offerings. Whether for customer-facing applications, community portals, or developer platforms like APIPark, self-registration streamlines the onboarding process, allowing users to quickly leverage capabilities such as integrating diverse AI models or accessing REST services securely.
We delved into the technical heart of Keycloak, meticulously detailing the configuration steps for enabling self-registration, customizing the user-facing forms through theming and the User Profile SPI, and implementing crucial security measures like email verification and password policies. Advanced topics, including extending user profiles, customizing email templates for consistent branding, and ensuring internationalization, were explored to equip you with the tools for a truly tailored and global user experience. Furthermore, we underscored the absolute necessity of robust security considerations, from implementing bot protection through CAPTCHA integrations to establishing comprehensive rate limiting and diligent event monitoring, ensuring that the ease of self-registration does not compromise the integrity of your identity system.
Finally, we examined the seamless integration of Keycloak self-registration with various application architectures, highlighting the utility of client adapters and the fundamental principles of OAuth 2.0 and OpenID Connect flows. The discussion extended to microservices environments, illustrating how Keycloak acts as a central identity provider, securing API interactions and ensuring consistent access control across distributed systems. The ongoing commitment to monitoring, auditing, and maintenance, through event logs, admin console management, performance optimization, and regular security audits, reinforced the message that a resilient self-registration system is a living, evolving entity.
By embracing Keycloak self-registration, organizations are not merely automating a process; they are investing in user empowerment, operational efficiency, and a fortified security posture. Itβs about building trust from the first click, fostering seamless interactions, and creating a scalable foundation for digital growth. The future of identity management is user-centric, and Keycloak provides the platform to realize this vision, allowing your users to step confidently into your digital world.
Frequently Asked Questions (FAQs)
- What is Keycloak self-registration, and why is it important? Keycloak self-registration is a feature that allows users to create their own accounts for applications secured by Keycloak, directly from the login page, without administrative intervention. It's crucial because it significantly enhances user experience by providing instant access, reduces administrative burden and costs, and allows organizations to scale their user base more efficiently. It empowers users by giving them control over their initial account setup.
- How do I enable self-registration in Keycloak? To enable self-registration, log into the Keycloak Admin Console, select your desired realm, navigate to
Realm Settings, click on theLogintab, and toggle the "User registration" switch to ON. It's highly recommended to also enable "Verify Email" to ensure the legitimacy of registered accounts. - Can I customize the self-registration form to collect more information? Yes, Keycloak allows extensive customization of the registration form. You can achieve this primarily by creating a custom login theme that extends the default Keycloak theme and modifying the
register.ftltemplate. For Keycloak versions 17 and above, you can also use theRealm Settings -> User Profilefeature to define custom attributes, specify their types, validations, and display them on the registration form without directly editing the FreeMarker template. - What are the key security considerations when implementing self-registration? Implementing self-registration requires strong security measures to prevent abuse. Key considerations include:
- Email Verification: Always enable email verification to confirm user ownership of the email address.
- Strong Password Policies: Enforce complex password requirements.
- Bot Protection: Integrate CAPTCHA or reCAPTCHA (requires custom theme/SPI) to combat automated registrations.
- Rate Limiting: Implement server-level rate limiting for registration attempts.
- Monitoring: Track
REGISTERevents in Keycloak logs for suspicious activity and integrate with a SIEM for proactive alerting. - Regular Audits: Periodically review configurations and event data.
- How does self-registration integrate with my existing applications? Keycloak integrates with applications primarily through industry-standard protocols like OAuth 2.0 and OpenID Connect. For many popular frameworks, Keycloak provides client adapters (e.g., Java, JavaScript) that simplify the integration process by handling token exchange, session management, and secure redirections. When a user self-registers and logs in, Keycloak issues tokens containing user identity information (claims) that your application can then use to authenticate the user and manage their access to resources.
πYou can securely and efficiently call the OpenAI API on APIPark in just two steps:
Step 1: Deploy the APIPark AI gateway in 5 minutes.
APIPark is developed based on Golang, offering strong product performance and low development and maintenance costs. You can deploy APIPark with a single command line.
curl -sSO https://download.apipark.com/install/quick-start.sh; bash quick-start.sh

In my experience, you can see the successful deployment interface within 5 to 10 minutes. Then, you can log in to APIPark using your account.

Step 2: Call the OpenAI API.
