API object security is based on the OAuth 2.0 protocol. So, when an API object with a security scheme has been defined, it is necessary to make some configurations in the GAM Backend.
Suppose you have an API object in which a security scheme has been defined. Then, you must follow the steps described below.
Select Build > Run GAM Backend in the GeneXus Toolbar. This will direct you to a tab in your browser where you should add the following information:
User: admin
Password: admin123
When you click on "SIGN IN", you will be directed to Applications to select the KB. In this case, it is KBAPIObjectSecurityScheme:
Click on "EDIT," and in Configuration, follow the steps below:
- Enable "Allow authentication v.2.0?" and "Can get user roles?".
- Copy Client ID and Client secret.
- Click on Confirm.
To be able to connect to that server from anywhere, you will have to add the Client ID and Client secret data, so you will have to copy that data into memory.
API object security scheme
HowTo: Access secure REST services defined via API Objects