내용으로 건너뛰기

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

질문됨 3년 전449회 조회
1개 답변
0
수락된 답변

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

답변함 3년 전
전문가
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.