Sign in

Component: <SignIn>

<SignIn> renders a link that initiates the MonoCloud sign-in flow.

It can be used in both App Router and Pages Router, and may be rendered from either Server or Client Components.

Props

PropertyTypeDescription
acrValues?string[]Authentication Context Class Reference (ACR) values requesting specific authentication assurance levels or methods.
authenticatorHint?AuthenticatorsHint to the authorization server indicating which authenticator or connection should be used.
childrenReactNodeContent rendered inside the link (for example, button text).
display?DisplayOptionsPreferred display mode for the authentication UI.
loginHint?stringHint identifying the user (for example, email or username). Used to prefill or optimize the sign-in experience.
maxAge?numberMaximum acceptable time (in seconds) since the user last authenticated. If exceeded, the user may be required to sign in again.
prompt?PromptControls authentication interaction behavior. For example, forcing login or consent.
resource?stringSpace-separated list of resource indicators that scope the issued access token.
returnUrl?stringURL to redirect to after successful sign-in.
scopes?stringSpace-separated list of scopes requested during authentication.
uiLocales?stringPreferred UI language.

Examples

import { SignIn } from "@monocloud/auth-nextjs/components";

export default function Home() {
  return <SignIn>Sign In</SignIn>;
}

You can customize the authorization request by passing props:

import { SignIn } from "@monocloud/auth-nextjs/components";

export default function Home() {
  return (
    <SignIn
      loginHint="user@example.com"
      authenticatorHint="password"
      returnUrl="/dashboard"
    >
      Sign In
    </SignIn>
  );
}
© 2024 MonoCloud. All rights reserved.