Example File (Builder project Advanced Modeling/Security):

<your example path>\Advanced Modeling\Security\uml\interceptorHelloWorldAdvanced.xml

This example uses the file "roles.txt". Within this file there is a list of users and their role. The file can be found at:
<your example path>\Advanced Modeling\Security\resources\templates\txt


In this example the authentication is done directly a the E2E Bridge (no proxy defined) and the authorization is done via the role concept and the interceptor model within the pre-processor activity diagram.
In the component diagram the user "firstUser" with password "firstuser" is defined; so when testing this example with the E2E Debugger the user authtentication must be set via the properties dialogue of the test case. The user name and password set here are used to create the correct SOAP header values.

Figure: Properties Dialogue for setting username/password

Figure: HTTP Header tab for setting username/password

If these settings are used the test cases of the example should run without error. If you provide an unknown user or a wrong password you will receive the following error:

Figure: Unauthorized Request error

When manipulating the authorization file C:\E2EBridgeDocumentation\E2EExamples\Advanced Modeling\testfiles\security\roles.txt and setting the role of "firstUser" to
"BusinessApp" then only the request "createSimpleObjectInOut1" will be executable with this user (according to the use case model defined at: Defining a role hierarchy).

Figure: Content of roles file

When now executing the testcase "createSimpleObject" you will receive the following error:

Figure: Executing request with user having not the proper role

Executing "createSimpleObjectInOut" will still be accessible and return the following output:

Figure: Executing request with correct user and correct role

Related Pages: