@cori-risi/cori.data.api / SSOAuthenticator
SSOAuthenticator()
SSOAuthenticator(
props
):Element
Defined in: lib/@cori-risi/components/SSOAuthenticator.tsx:88
This is a generalization of the Single Sign-On authentication component developed for the Calix Impact Tool
This component is best placed in main.js
as part of the initial React root component mounting code:
import { SSOAuthenticator } from "@cori-risi/cori.data.api";
import '@aws-amplify/ui-react/styles.css';
import "@cori-risi/cori.data.api/inst/dist/cori.data.api.css";
// ...
const AppWithAuthenticator = withAuthenticator(App, {
: signInFormFields,
formFields: true,
hideSignUp: ['username']
loginMechanisms;
})
export function renderToDom(container: HTMLElement) {
createRoot(container).render(<React.StrictMode>
<AmplifyContextProvider
={import.meta.env.VITE_COGNITO_DOMAIN}
domain={import.meta.env.VITE_REGION}
region={import.meta.env.VITE_IDENTITY_POOL_ID}
identityPoolId={import.meta.env.VITE_USER_POOL_ID}
userPoolId={import.meta.env.VITE_USER_POOL_CLIENT_ID} >
userPoolClientId!!window.location.port && window.location.port.toString() === "5173") ? (
{(<App />
: (
) <SSOAuthenticator
={"IdentityProviderName"}
provider={"App Title"}>
title<AppWithAuthenticator />
</SSOAuthenticator>
: (
) <App />
)}</AmplifyContextProvider>
</React.StrictMode>);
}
Parameters
props
children?
ReactElement
<any
, string
| JSXElementConstructor
<any
>>
description?
string
(optional) description or instructions to be displayed on authentication component
logo?
string
(optional) imported svg file (see example) to be displayed on authentication component
provider?
string
name of the Identity Provider configured in AWS Cognito > Social and custom providers > Federated identity provider sign-in
title?
string
name of the application (should be same as the value of the title element in index.html)
Returns
Element