Hi Joao,
Something else I should have mentioned before...
If you're calling the AAC Authentication Service from a REST client (working with JSON) then you should use the API endpoint instead of the standard endpoint:
http://<reverse-proxy>/mga/sps/apiauthsvc?PolicyId=urn:...:myPolicy
In this case the authentication service will expect to receive POST and get incoming attributes within body as JSON format:
{ myAttr: "test"}It will also look for a template file with .html replaced with .json when building responses. This will set the response type to application/json too.
If your policy will require multiple steps then you should include @ACTION@ and @STATE@ macros in your responses. These are needed so that the next call can include the stateId query string which links it into the in-progress policy (rather than using cookies).
You can see examples of this within the built-in InfoMaps in the AAC. If you search in the AAC template pages for .json files you'll find them in the ci folder and in eula folder etc.
Jon.
------------------------------
Jon Harry
Consulting IT Security Specialist
IBM
------------------------------
Original Message:
Sent: Tue June 01, 2021 09:42 AM
From: Jon Harry
Subject: AAC Policy as REST
Joao,
You can pass additional query string parameters in the call to the AAC authentication service.
...?PolicyId=....&myattr=test
You can read them out from the request context:
var myattr = context.get(Scope.REQUEST, "urn:ibm:security:asf:request:parameter", "myattr");
Jon.
------------------------------
Jon Harry
Consulting IT Security Specialist
IBM
------------------------------
Original Message:
Sent: Tue June 01, 2021 09:29 AM
From: Joao Goncalves
Subject: AAC Policy as REST
Is it possible to pass parameters other than PolicyId to the URL authsvc? How can I get them, in the InfoMap?
------------------------------
Joao Goncalves
Pyxis, Lda.
+351 91 721 4994
Original Message:
Sent: Tue June 01, 2021 08:26 AM
From: Jon Harry
Subject: AAC Policy as REST
Hi Joao,
I got the impression you were hoping to return a JSON response from the policy? In that case your template page would probably be more like:
@JSON@
and then populate the JSON into that macro within your InfoMap JavaScript.
If you need to set headers (content-type etc.), I think you could do that with service-side scripting capability in the template also.
If I misunderstood what you're trying to do then please correct me.
Jon.
------------------------------
Jon Harry
Consulting IT Security Specialist
IBM
Original Message:
Sent: Tue June 01, 2021 07:07 AM
From: Joao Goncalves
Subject: AAC Policy as REST
Really don't understand what you mean.
Should I create a template page with a content like <html><body>@EMAIL@</body></html>, with just a macro?
Then the mapping rule can just populate the @EMAIL@ macro, and do whatever I need, and return a json file as a result of the policyId?
------------------------------
Joao Goncalves
Pyxis, Lda.
+351 91 721 4994
Original Message:
Sent: Tue June 01, 2021 06:58 AM
From: Jon Harry
Subject: AAC Policy as REST
Hi Joao,
You can't directly specify a response to return, it is always a template page. However, the template page could contain a single macro which is populated from within the InfoMap. If your InfoMap returns "end policy without credentials", this will cause the specified template page to be returned immediately.
Jon.
------------------------------
Jon Harry
Consulting IT Security Specialist
IBM