Introduction
Are you using the BTP Authentication feature in your AppGyver app and you want to know who is using the application?
In this guide I will explain quickly how to get the logged-in user information as email, first name or last name.
Steps
- Create a REST API data source
- Define a data variable
- Display user data
- Create a REST API data source
Go to the DATA tab and create an AppGyver classic data entity -> REST API direct integration.
Call the data source
userApi
AppGyver classic data entity - REST API
Set the settings to:
Resource ID: userAPI
Resource URL: user-api/currentUser
BASE userApi
Define the GET RECORD (GET) without an URL Placeholder and remove the /{id} from the Relative path.
get Record (GET)
Go to the SCHEMA Tab and create the following schema by clicking ADD Property.
You need displayName, email, firstname, lastname, name all type of text. Additionally you need scopes as list of texts.
Add schema properties
2. Define a data variable
Add a new data variable for the userAPI as data variable type “Single data record” and modify the logic that it just get the records and set the data variable. Remove the delay part.
data variable userApi
3. Display the user information
Now you can use the data variable userApi to display the logged-in user information.
Bind text field to data variable
Final result