Many steps to get the GAM - Repository ready to be used can be executed from GeneXus IDE. The behavior results from the fact that GeneXus checks in F5 (Build All) process if it's necessary to create GAM database tables, or just execute a reorganization in GAM database, or do nothing (because the GAM repository already exists and is up to date).
In F5, a connection is stablished to the database specified in GAM data store (using the connection properties of this data store: database name, user id, user password), and checks the existency of some tables and GAM version.
If these tables don't exist, the GAM database tables are created with the Repository ID specified.
If these tables already exist, the necessary reorg is executed, and afterwards and initialization is done, where Repository ID, Administrator User Name Property, Administrator User Password Property, Connection User Name Property and Connection User Password Property are checked.
Besides, upgrading GeneXus Access Manager version, changing the GAM data store, or creating a new environment, are actions where some considerations should be taken into account.
So, in this paper we sum up some of these situations and the considerations to be taken.
See Creating the GAM repository for the first time from GeneXus (X Evolution 3)
Supposing you have a KB where Enable Integrated Security Property has already been activated, but a new GeneXus build is installed (where GAM has changes). Suppose the KB uses version X of GAM and a new build is applied where a new version of GAM is available, so the GAM objects and GAM repository need to be updated.
This update is done automatically. After doing "Build All" to the KB the following happens:
1. The GAM API is imported automatically.
2. The necessary reorganization is executed in GAM repository.
After changing the GAM data store properties, or the environment generator, you have to "Rebuild All", and all the GAM execution files (connection.gam and application.gam) are moved to the model directory.
The database reorganization is done if needed.
If a new environment is created in a KB where GAM is already activated (Enable Integrated Security Property = Yes).
One possibility is that the new environment uses the same GAM.
GeneXus detects when the database specified in "Database name" property for the Reorg data store has already a GAM repository. In case it has, the Administrator User Name Property, Administrator User Password Property, Connection User Name Property and Connection User Password Property properties are not initialized, and the GeneXus user has to set those properties manually.
In this case, Repository Id property remains the same as the previous environment.
So, if in this new environment you specify the same database name as another existing environment of the KB, the connection properties have to be set manually.
In case you specify a different GAM database, it's the same as explained in case A.
In case of connecting to a external GAM repository, the Repository ID property has to be set. In this case, when the "Build All" is done, GeneXus detects that this repository (with the connection properties associated to it) is a valid GAM repository so it's no need to create a new GAM database, neither try to make reorganizations to this database. This is the typical case of using GXserver, where many KBs will use the same GAM repository.
See HowTo: Using the same GAM Database by different applications
See Managing GAM Repositories and GAM Applications in GX development time