GopalSharma / moodle-auth_azureb2c

The Azure AD B2C Connect plugin provides registering of a new user and single-sign-on functionality using configurable identity providers, scope and custom policies of Azure B2C.
GNU General Public License v3.0
2 stars 7 forks source link

ENTRA iso AAD #37

Open danielavetica opened 4 months ago

danielavetica commented 4 months ago

MIcrosoft has changed their name from "Azure" to "Entra".

The AzureB2C plugin uses the "local_0365" plugin database field "aadupn"

However, the Local_o365 plugin has changed multiple fields from AAD to ENTRA: (from Line 1105 in /local_o365/db/upgrade.php)

   `// Step 2: Rename "aadupn" column to "entraidupn" in local_o365_connections table.
    $table = new xmldb_table('local_o365_connections');

    // Drop "aadupn" index.
    $index = new xmldb_index('aadupn', XMLDB_INDEX_UNIQUE, ['aadupn']);
    // Conditionally launch drop index aadupn.
    if ($dbman->index_exists($table, $index)) {
        $dbman->drop_index($table, $index);
    }

    // Rename "aadupn" column to "entraidupn".
    $field = new xmldb_field('aadupn', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'muserid');
    // Conditionally launch rename field "aadupn" to "entraidupn".
    if ($dbman->field_exists($table, $field)) {
        $dbman->rename_field($table, $field, 'entraidupn');
    }

    // Recreate "entraidupn" index.
    $index = new xmldb_index('entraidupn', XMLDB_INDEX_UNIQUE, ['entraidupn']);
    // Conditionally launch add index entraidupn.
    if (!$dbman->index_exists($table, $index)) {
        $dbman->add_index($table, $index);
    }

    // O365 savepoint reached.
    upgrade_plugin_savepoint(true, 2022112820, 'local', 'o365');
}` 

So, My guess is... this plugin should be updated to listen to "entraupn" instead of "aadupn".

As currently, users get this error message: image

Mor-dev commented 4 months ago

Same issue here!