AWS Amplify Angular adding SSO to existing cognito deepfreeze error

Discussão em 'Angular' iniciado por dcp3450, Abril 4, 2025.

  1. dcp3450

    dcp3450 Guest

    I currently have an auth page setup for a user to login with aws-amplify/ui-angular and aws-amplify

    <div class="sso-button">
    <button mat-button (click)="launchSSO()">SSO Login</button>
    </div>
    <amplify-authenticator [hideSignUp]="true">...</amplify-authenticator>


    When the user selects the buttong it triggers the launchSSO() method that sends the user to a hosted cognito sso page. The backend team is allowing the user to enter their person login info there and do their "magic" to authenticate and kick back a code so I can pull user auth info from cognito:

    Amplify.configure({
    Auth: {
    Cognito: {
    userPoolClientId: <clientId>,
    userPoolId: <userPool>,
    loginWith: {
    oauth: {
    domain: <cognito endpoint>,
    scopes: <scopes>,
    redirectSignIn: <app url>,
    redirectSignOut: <app url>,
    responseType: 'code'
    }
    }
    }
    }
    });
    signInWithRedirect({ provider: {custom: 'Cognito'} });


    However when I click the button I get a typeError: Cannot freeze error. Amplify's docs assume you're building an Amplify application but we're simply using it to leverage cognito. The freeze error seems to be point to two areas:

    Each page (aside from the auth) has a canActivate associated to it as an auth guard servcie and points to the fetchAuthSession and the line where Amplify.configure is called where amplify is calling deepfreeze.

    I'm not sure why that typeError is triggered, how to resolve it, or if I'm even doing this SSO correctly given the docs aren't the cleariest for this type of usage.

    Continue reading...

Compartilhe esta Página