Hi Nick,

By default, authentication is disabled in EDG Studio. When doing API requests 
in this mode, a cookie with the user name, e.g., “username=Administrator” 
should be included with every request.

The EDG Studio documentation doesn’t have anything on configuring 
authentication. This topic is covered in the docs for the full EDG server 
product, but not all of that is applicable to Studio.

To enable basic authentication, here is what works for me.

First I create a file called setup.basic-auth.properties in the EDG Studio 
directory. The file contains:

authMethod=basic
securityRoles=administrator,manager,user,viewer

(If you want to know what else can be configured in this file, launch Studio in 
the usual way and navigate to 
http://localhost:8083/assets/edg-setup/edg-setup.properties 
<http://localhost:8083/assets/edg-setup/edg-setup.properties> to get a 
template. A few of the options won’t work in EDG Studio.)

Now I edit the file conf/users.xml to define my users, passwords, and roles. 
Note that all users and roles are commented out initially. The <role> elements 
must match the list of securityRoles defined earlier in the setup file.

Now I launch EDG Studio with the shell command: edg -s 
setup.basic-auth.properties

EDG should launch with basic authentication enabled. The browser should pop up 
a dialog asking for username and password. Any of the credentials configured in 
users.xml should work.

Initially, all roles will get administrator rights. To change that, I log in 
and go to Server Administration > Rights Management, then select my 
administrator role, and add AdministratorGroup to it. Then I select ANY_ROLE 
and remove AdministratorGroup from it. Now, only members of the administrator 
role will be able to access Server Administration etc.

Now I can use incognito windows to log in as different users.

Hope that helps,
Richard





> On 21 Jun 2023, at 16:16, Nick Sacoman <[email protected]> 
> wrote:
> 
> Hi there,
> 
> Thanks so much for the quick response! Apologies for missing some key 
> information - I'm using EDG Studio. When I launch EDG Studio from localhost, 
> I'm automatically signed in as administrator. I'm a bit new to the tool, so I 
> have not configured the instance for Basic Authentication - are there 
> documentation references for doing so?
> 
> Also - I did not specify, but the {taxonomy name} was a placeholder, I did 
> format that portion of the API URL as the Swagger UI instructed me to do.
> 
> Thanks,
> Nick
> 
> On Wednesday, June 21, 2023 at 10:58:14 AM UTC-4 Richard Cyganiak wrote:
> Hi Nick,
> 
> Is this with EDG Studio or is it with edg.war on Tomcat? Which version of EDG?
> 
> Has EDG been configured for HTTP Basic Authentication? In other words, when 
> logging in to EDG in the browser, is the login form a browser popup dialog, 
> as opposed to some kind of web form?
> 
> The service URL looks a bit off. The {taxonomy_name} part should be the ID of 
> the asset collection, without { } around it. You can find the URL by 
> navigating to your asset collection in EDG, then going to the Reports tab, 
> selecting Web Services Swagger UI, and finding exportRDFFile in the list.
> 
> Hope that helps,
> Richard
> 
> 
> 
> 
> 
>> On 21 Jun 2023, at 15:05, Nick Sacoman <[email protected] 
>> <applewebdata://A68F2C5A-B16A-435F-AC6E-85BF9DD6753A>> wrote:
>> 
> 
>> I currently am testing one of the API endpoints: specifically the 
>> exportRDFFile endpoint for a taxonomy. I've read the documentation and have 
>> configured BasicAuth with my Python request. I'm running into an error I 
>> will post below along with my code stub. I've tried this with all user 
>> accounts to no avail (it is on my localhost, I am the admin for more 
>> clarity). I would appreciate some pointers to get this cleared up.
>> 
>> Code stub (Python3):
>> `session = requests.Session()`
>> `session.headers.update({"Connection": "Keep-alive"})`
>> `res = 
>> session.get("http://localhost:8083/tbl/service/{taxonomy_name}/tbs/exportRDFFile?format=json-ld
>>  
>> <http://localhost:8083/tbl/service/%7Btaxonomy_name%7D/tbs/exportRDFFile?format=json-ld>",
>>  auth=HTTPBasicAuth("user", "password")).text`
>> 
>> Response (res):
>> "Cannot invoke org.topbraid.auth.TBUser.canUpdate(org.topbraid.auth.Asset) 
>> because the return value of org.topbraid.auth.user.TBUserFactory.getUser() 
>> is null."
>> 
> 
>> -- 
>> The topics of this mailing list include TopBraid EDG and related 
>> technologies such as SHACL.
>> To post to this group, send email to [email protected] 
>> <applewebdata://A68F2C5A-B16A-435F-AC6E-85BF9DD6753A>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "TopBraid Suite Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <applewebdata://A68F2C5A-B16A-435F-AC6E-85BF9DD6753A>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/topbraid-users/d1702a77-1f11-4b86-883e-fe083954d627n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/topbraid-users/d1702a77-1f11-4b86-883e-fe083954d627n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> The topics of this mailing list include TopBraid EDG and related technologies 
> such as SHACL.
> To post to this group, send email to [email protected]
> --- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/topbraid-users/e0df0b2f-a4ca-4fcc-b4e2-b547be65effen%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/topbraid-users/e0df0b2f-a4ca-4fcc-b4e2-b547be65effen%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
The topics of this mailing list include TopBraid EDG and related technologies 
such as SHACL.
To post to this group, send email to [email protected]
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/4C4A5080-64C7-43B0-BF14-634EDEB802FC%40topquadrant.com.

Reply via email to