Secured endpoint exporting all freshly registered users
Hi everyone,
I need to provide a stream to partner with the following informations :
- Login
- registration date
- last connection date
- SSO iD
- total of posts
- total of logins
We plan to create an endpoint combining several rest api calls.
This stream has to be private as it will contain private information.
My concern is that I don't know how to restrict properly the access to my partner only.
Have you done that before ?
Do you have recommendation ?
Clement
clemlith Do you wish to provide the access to this data outside the lithium community? if yes, then you need to handle the access on the other platform, but in case you want to put access to the endpoint data inside the community itself, then you can do following:
Once you make all the REST calls and export the users data, make a Partner_role and use the following code to access this data
<#if user.registered > <#-- if the user is not anonymous --> <#assign show_module = false /> <#list restadmin("/users/id/${user.id?c}/roles").roles.role as role> <#-- REST call to get the user's roles --> <#if role.name?? && (role.name == "Parnter_Role")> <#assign show_module = true /> </#if> </#list> <#if show_module> <!-- the code goes here --> </#if> </#if>
I hope this helps.