amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

Use custom login page for AzureAD login using Oauth - Please close the issue as i have created it wrongly here #163

Closed maheshmgopi closed 5 years ago

maheshmgopi commented 5 years ago

I am developing a reactjs application which uses the Oauth of aws amplify for signing in to AzureAD. I configured the aws as following.

export const AWSConfig = {
  region: 'xxxxxx',
  userPoolId: 'xx-xxxx-XXXXX',
  userPoolWebClientId: 'XXXXX',
  authenticationFlowType: 'USER_SRP_AUTH',
  oauth: {
    domain: 'xxxxxxx.domain.com',
    redirectSignIn: `${window.location.origin}/`,
    redirectSignOut: `${window.location.origin}/logout`,
    responseType: 'code',
    scope: [
      'phone',
      'email',
      'profile',
      'openid',
      'aws.cognito.signin.user.admin',
    ],
  },
};

The redirecting to the azure ad login page was not happening automatically from within the aws amplify library which happens automatically with adal(for angular). So I redirected to the azure ad login page manually. Now I want to show my own login page instead of the Azure AD login. I am using Authenticator like below

<Authenticator hideDefault hide={[SignIn]}>
            <Login            
              onLogin={this.login}
            />
</Authenticator>

This is also not working. This case is not mentioned in the documentation. Where Login is my custom login page. The redirectSignIn, redirectSignOut have been configured correctly in the user pool settings in aws cognito. Any help would be appreciated.