Amplify Login Only refers to configuring the AWS Amplify Authenticator UI component to display a sign-in screen without a sign-up option, so users can only log in with credentials an administrator already created for them. This setup is common for internal tools, admin dashboards, and invite-only apps where self-registration should not be available. Amplify, AWS’s development platform for web and mobile apps, makes this possible through a single prop called hideSignUp, which developers add to the Authenticator component in React, React Native, Vue, Angular, and other supported frameworks.
What Is Amplify Login Only?
Amplify Login Only is not a separate product or feature name. It is the common term developers use for hiding the sign-up form inside the Amplify UI Authenticator, leaving only the sign-in form visible to users. Under the hood, this is controlled by the hideSignUp prop, first added to the Authenticator in 2020 through a pull request to the amplify-js repository.
Without this configuration, the Authenticator displays both sign-in and sign-up tabs by default, along with a “Create account” link. Setting hideSignUp to true removes that link and the registration form entirely, so new users cannot self-enroll through the app’s UI.
How Do You Set Up Amplify Login Only?
You set up Amplify Login Only by passing hideSignUp={true} to the Authenticator component in your app’s root file. For React apps, this looks like wrapping your app content inside <Authenticator hideSignUp={true}> and rendering your protected components as children.
export default function App() {
return (
<Authenticator hideSignUp={true}>
{({ signOut }) => <button onClick={signOut}>Sign Out</button>}
</Authenticator>
);
}
For React Native apps, the pattern is slightly different because the Authenticator uses a components prop to override individual screens. You pass a custom SignIn component that spreads the default props and adds hideSignUp, as documented in Amplify’s React Native Authenticator configuration guide.
How Do You Add Users When Sign-Up Is Disabled?
When sign-up is disabled, administrators create user accounts manually through Amplify Studio or the Amazon Cognito console instead of letting users register themselves. In Amplify Studio, this is done through the User Management section, where an admin can add a username, temporary password, and required attributes.
This workflow is common for business applications where account creation should be controlled, such as employee portals or client-facing dashboards tied to a specific organization. Cognito, the identity service behind Amplify Auth, still handles authentication, password resets, and multi-factor authentication normally; only the self-registration path is removed from the app’s UI.
What Login Mechanisms Work With Amplify Login Only?
Amplify Login Only still supports the same login mechanisms available to the full Authenticator, including email, phone number, or username, depending on how the backend is configured. The loginMechanisms prop lets developers explicitly define which identifier users sign in with, for example loginMechanisms={['email']} or loginMechanisms={['phone_number']}.
If no value is set, Amplify infers the login mechanism automatically from the backend configuration pulled through amplify pull. Note that signing in with a plain username is not supported on Amplify Gen 2 backends, so email or phone number are the more common choices for newer projects.
Why Would a Developer Use Amplify Login Only Instead of Sign-Up?
Developers use Amplify Login Only when an application should not allow open, self-service account creation. Typical cases include internal admin tools, apps distributed to a known set of employees or partners, and products where accounts are provisioned through a separate onboarding or invitation process.
This approach also reduces exposure to spam sign-ups and unauthorized account creation, since the only way to get an account is through an administrator or a backend process, not a public form. It does not change how sign-in itself works; users still authenticate through Cognito with their assigned credentials.
Conclusion
Amplify Login Only gives developers a straightforward way to limit an app’s Authenticator to sign-in only, using the hideSignUp prop across React, React Native, and other supported frameworks. It suits apps where accounts are provisioned by an administrator rather than created by users themselves, while still relying on Amazon Cognito for secure authentication underneath. For the most current prop names and framework-specific examples, check Amplify’s official Authenticator configuration documentation before deploying to production.
FAQs
What does hideSignUp do in AWS Amplify?
The hideSignUp prop removes the sign-up form and “Create account” link from the Amplify Authenticator UI, leaving only the sign-in screen visible. It does not disable account creation entirely; administrators can still add users through Amplify Studio or Amazon Cognito.
Can I still reset a forgotten password with Amplify Login Only enabled?
Yes. Hiding sign-up only affects new account registration, not existing account features like password reset. The “Forgot password” flow remains available on the sign-in screen unless it is separately disabled.
Does Amplify Login Only work with React Native?
Yes, but the setup differs slightly from React. In React Native, developers pass a custom SignIn component through the Authenticator’s components prop and add hideSignUp to that component, as shown in Amplify’s official React Native documentation.
How do I add users if sign-up is hidden?
Administrators can add users manually through the User Management section of Amplify Studio or directly in the Amazon Cognito console. This lets you assign usernames, temporary passwords, and required attributes without exposing a public sign-up form.
Is Amplify Login Only supported in Amplify Gen 2?
Yes, hideSignUp continues to work in Amplify Gen 2 projects. One limitation to note is that username-based sign-in is not supported on Gen 2 backends, so email or phone number should be used as the login mechanism instead.
