Description=This method can be used by Trusted Devices to generate a token. The generated Token will carry all the information regarding the device, user, etc. and is required to consume most of the methods of UNIAPI with specific user context. The token generated is valid during the next 24 hours (configurable in GVP).
The logged token can be easily identified because it starts with the chars: <span style="color: #a11;">AU_</span>
This method will verify that the Device(deviceType/deviceId) provided is linked to the current user as TrustedDevice, and it will verify that the Device is enabled.
The UNIAPI will only allow users in Active status to login (excluded and suspended users will return an exception). For users in AwaitingEmailConfirmation status, it depends on a flag configured at instance level (''GVP_INSTANCES.AllowLoginBeforeEmailConfirmationFlag''):
* If ''AllowLoginBeforeEmailConfirmationFlag = true'', if the user tries to login in AwaitingEmailConfirmation status, the login will be allowed and the user status will be changed to Active status.
* If ''AllowLoginBeforeEmailConfirmationFlag = false'', then [[UNIAPI_Specification#UserNotYetActivatedException|UserNotYetActivatedException]] is thrown.
TODO: link with enumeration.
==== Geo-Location ====
This method applies GeoLocation restriction. It extracts the IP address from the request and retrieves the Country of the IP from the MaxMind Database. Then, it verifies if the Country from where the request was generated is linked to the instance (GVP_INSTANCES). If not, [[UNIAPI_Specification#UserTryingToRoamingException|UserTryingToRoamingException]] exception is thrown.
The user can be marked as Geoblocking whitelist (inside User Profile, GVP_USERS). In this case, the Geoblocking is not applied for this user.
==== BI ====
This method creates an entry in GVP_LogLogin collection (even if the login was successful or not)