testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java
/**
     * Test for KEYCLOAK-1372 - verify email action is not performed if email is provided but email trust is enabled for the provider
     */
Test for KEYCLOAK-1372 - verify email action is not performed if email is provided but email trust is enabled for the provider
Test for KEYCLOAK - 1372 - verify email action is not performed if email is provided but email trust is enabled for the provider
@Test
    public void testSuccessfulAuthenticationWithoutUpdateProfile_emailProvided_emailVerifyEnabled_emailTrustEnabled() {
        getRealm().setVerifyEmail(true);
        brokerServerRule.stopSession(this.session, true);
        this.session = brokerServerRule.startSession();
        IdentityProviderModel identityProviderModel = getIdentityProviderModel();
        try {
            identityProviderModel.setUpdateProfileFirstLoginMode(IdentityProviderRepresentation.UPFLM_OFF);
            identityProviderModel.setTrustEmail(true);
            UserModel federatedUser = assertSuccessfulAuthentication(identityProviderModel, "test-user", "test-user@localhost", false);
            assertFalse(federatedUser.getRequiredActions().contains(RequiredAction.VERIFY_EMAIL.name()));
        } finally {
            identityProviderModel.setTrustEmail(false);
            getRealm().setVerifyEmail(false);
        }
    }
@ Test public void testSuccessfulAuthenticationWithoutUpdateProfile_emailProvided_emailVerifyEnabled_emailTrustEnabled ( ) { getRealm ( ) . setVerifyEmail ( true ) ; brokerServerRule . stopSession ( this . session , true ) ; this . session = brokerServerRule . startSession ( ) ; IdentityProviderModel identityProviderModel = getIdentityProviderModel ( ) ; try { identityProviderModel . setUpdateProfileFirstLoginMode ( IdentityProviderRepresentation . UPFLM_OFF ) ; identityProviderModel . setTrustEmail ( true ) ; UserModel federatedUser = assertSuccessfulAuthentication ( identityProviderModel , "test-user" , "test-user@localhost" , false ) ; assertFalse ( federatedUser . getRequiredActions ( ) . contains ( RequiredAction . VERIFY_EMAIL . name ( ) ) ) ; } finally { identityProviderModel . setTrustEmail ( false ) ; getRealm ( ) . setVerifyEmail ( false ) ; } }
Test for KEYCLOAK-1372 - verify email action is not performed if email is provided but email trust is enabled for the provider
Test for KEYCLOAK - 1372 - verify email action is not performed if email is provided but email trust is enabled for the provider