1. outline
The Unifinity application can retrieve user information for users authenticated by Player.
This page explains the procedure for checking whether a user authenticated by Player belongs to a specified group and changing the screen display content accordingly.
The sample project used in the explanation can be downloaded from the following link.
2. Operation image
3. Implementation method (explanation of key points only)
3-1 Creation of group affiliation check process
Determines whether the user belongs to the group whose name is specified in the parameter.
1" to belong to the group with the specified name,
If the group does not belong to the group with the specified name, "0" is the result of the process.
#3- Obtaining user information
UniBaaS/login user information acquisitionto obtain information about the currently logged-in user.
If you want to refer to group information, select "All" for "User Information".
UniBaaS/login user information acquisitionIf "All" is selected in the "All" column, the result of the process will be the following data.
-
key value user key value id 12345 name username ... groups -
key value id 2345 name Group name A ...
key value id 3456 name Group name B ...
token_type bearer ... -
- The name of the group is stored in "groups" as the key "name".
#8- Judgment process
The "groups" obtained in #5 contains information on multiple groups.
Control statement/Foreach (start of iteration)Logic is used to retrieve group information one by one and check whether a group with the name specified in the parameter exists.
If a group is found, the process ends with a processing result of "1".
3-2 Creating Button Processing
Create a process to display the button only if the user belongs to the specified group by executing the "Membership Group Check Process".
4. precautions
With Unifinity Studio UniBaaS/login user information acquisitionIf you use UniBaaS, check the "UniBaaS authentication before debugging" checkbox under "PropertiesPreferences".