Saltar al contenido

Cognito otpauth name using hosted UI

0

HI,

I'm using the hosted Cognito UI for login/reset/TOTP and I want the google authenticator code to show my custom application name, but it shows 'AWSCognito'.

I understand using the API only I can amend AWSCognito as seen hereotpauth://totp/AWSCognito:${email}?secret=${code}&issuer=https://cognito-idp.ap-southeast-2.amazonaws.com/

Is there a way with the hosted UI?

Thx Dan

preguntada hace 3 años447 visualizaciones
1 Respuesta
0
Respuesta aceptada

This has been solved. For those needing it:

import {
  Authenticator,
  Heading,
  Text,
  ThemeProvider,
  Theme,
  useTheme,
  View,
  useAuthenticator,
  Button,
} from '@aws-amplify/ui-react'

then wrap your app in the auth provider

 <Authenticator
          hideSignUp={true}
          formFields={formFields}
          components={components}
        >
          <Layout>
            <main>
              <Component previousPathname={previousPathname} {...pageProps} />
            </main>
          </Layout>
        </Authenticator>

and configure formField

const formFields = {
  setupTOTP: {
    QR: {
      totpIssuer: `CompanyName - ${process.env.NEXT_PUBLIC_ENV}`,
      totpUsername: email,
    },
...
  },
}

Thx Dan

respondido hace 3 años
EXPERTO
revisado hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.