Skip to content

Federated login button not showing with Cognito Hosted UI

0

Hello, I have connected my cognito user pool with Azure as my IDP now in my front end with react i am trying to use amplify for the login and i wrapped my application inside the Authenticator but the federated sign in is not showing in hosted ui.

This my Amplify config:

` Auth: { Cognito: { userPoolId: poolId, userPoolClientId: ClientId, loginWith: {

    oauth: {
      domain: myDomain,
      scopes: [
        "email",
        "profile",
        "openid",
        "aws.cognito.signin.user.admin",
      ],
      redirectSignIn: [

        "http://localhost:3000/",
      ],
      redirectSignOut: [

        "http://localhost:3000/",
      ],
      responseType: "code",
    },
  }
},

}, `

1 Answer
0
Accepted Answer

The issue you're experiencing with the federated sign-in button not showing in the Cognito Hosted UI could be due to a few reasons:

  1. Configuration in Cognito: Make sure that you have properly configured the Azure identity provider in your Cognito User Pool. This includes setting up the correct client ID, client secret, and authorized scopes for Azure.

  2. App Client Settings: In your Cognito User Pool's App Client settings, ensure that you have enabled the Azure identity provider for the specific app client you're using.

  3. Amplify Configuration: Your Amplify configuration looks mostly correct, but you might need to explicitly specify the federated sign-in provider. Try adding a 'federationTarget' property to your oauth configuration:

oauth: {
domain: myDomain,
scopes: [
"email",
"profile",
"openid",
"aws.cognito.signin.user.admin",
],
redirectSignIn: [
"http://localhost:3000/",
],
redirectSignOut: [
"http://localhost:3000/",
],
responseType: "code",
federationTarget: 'COGNITO_USER_POOLS'
}
  1. Hosted UI Customization: If you've customized the Hosted UI, make sure you haven't inadvertently hidden or removed the federated sign-in options.

  2. Browser Console: Check your browser's console for any error messages that might provide more insight into why the federated sign-in option isn't appearing.

If after checking these points the issue persists, you may need to review your Azure configuration to ensure it's correctly set up to work with Cognito. Also, consider using the Cognito console to view the Hosted UI directly (there's usually a "View Hosted UI" button) to see if the federated option appears there. If it does, the issue might be in your React application's implementation of the Authenticator component.
Sources
Managing the hosted UI and authorization server - Amazon Cognito
Using the user pools API and authorization server - Amazon Cognito
User pool endpoints and hosted UI reference - Amazon Cognito

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.