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

DanB
asked a year ago230 views
1 Answer
0
Accepted Answer

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

DanB
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions