Cataly...::Realm(3pm)
π NAME π
Catalyst::Authentication::Realm β Base class for realm objects. This is the Cataly...::Realm(3pm) page from the User Contributed Perl Documentation crew, bestie β¨
πΈ DESCRIPTION πΈ
This section is literally empty in the original β no cap, the tea starts in CONFIGURATION. π
π CONFIGURATION π
Okay so these are the config knobs, and yes they are important:
classβ By default this class is used byCatalyst::Plugin::Authenticationfor all realms. Theclassparameter allows you to choose a different class to use for this realm. Creating a new Realm class can allow for authentication methods that fall outside the normal credential/store methodology. main character energy for custom auth, fr fr πauto_create_userβ Set this to true if you wish this realm to auto-create user accounts when the user doesn't exist (most useful for remote authentication schemes). very remote-auth coded β¨auto_update_userβ Set this to true if you wish this realm to auto-update user accounts after authentication (most useful for remote authentication schemes). same remote-auth vibe, but update-y π¦use_sessionβ Sets session usage for this particular realm β overriding the globaluse_sesionsetting. yes, that spelling is in the original, bestie π
π METHODS π
Hereβs where the realm actually does stuff. Slay. π«Ά
β¨ new( $realmname, $config, $app ) β¨
Instantiates this realm, plus the specified store and credential classes.
π οΈ store( ) π οΈ
Returns an instance of the store object for this realm.
π credential( ) π
Returns an instance of the credential object for this realm.
π΅οΈ find_user( $authinfo, $c ) π΅οΈ
Retrieves the user given the authentication information provided. This is most often called from the credential. The default realm class simply delegates this call to the store object. If enabled, auto-creation and auto-updating of users is also handled here.
πͺ authenticate( $c, $authinfo) πͺ
Performs the authentication process for the current realm. The default realm class simply delegates this to the credential and sets the authenticated user on success. Returns the authenticated user object;
π¦ USER PERSISTENCE π¦
The Realm class allows complete control over the persistance of users between requests. By default the realm attempts to use the Catalyst session system to accomplish this. By overriding the methods below in a custom Realm class, however, you can handle user persistance in any way you see fit.
π persist_user($c, $user) π
persist_user is the entry point for saving user information between requests. In most cases this will utilize the session. By default this uses the catalyst session system to store the user by calling for_session on the active store. The user object must be a subclass of Catalyst::Authentication::User. If you have updated the user object, you must call persist_user again to ensure that the persisted user object reflects your updates.
π§ remove_persisted_user($c) π§
Removes any persisted user data. By default, removes the user from the session.
π user_is_restorable( $c ) π
Returns whether there is a persisted user that may be restored. Returns a token used to restore the user. With the default session persistance it returns the raw frozen user information.
β restore_user($c, [$frozen_user]) β
Restores the user from the given frozen_user parameter, or if not provided, using the response from $self->user_is_restorable(); Uses $self->from_session() to decode the frozen user.
π failed_user_restore($c) π
If there is a session to restore, but the restore fails for any reason then this method is called. This method supplied just removes the persisted user, but can be overridden if required to have more complex logic (e.g. finding a the user by their 'old' username).
π from_session($c, $frozenuser ) π
Decodes the frozenuser information provided and returns an instantiated user object. By default, this call is delegated to $store->from_session().
π₯ save_user_in_session($c, $user) π₯
DEPRECATED. Usepersist_userinstead. (this simply callspersist_user)
π okay thatβs the whole page, bestie β source/version perl v5.40.1, dated 2026-05-22, from Cataly...::Realm(3pm). now go be the main character of your auth stack π«Άβ¨
π¦ where this page comes from
- ubuntu stonking: libcatalyst-plugin-authentication-perl 0.10026-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms