on 06-21-2017 3:01 PM
Hi All,
I am working on a requirement where I need to Authenticate the Auth token being received in the HTTP header.
At this point I am assuming that I would need a Custom Adapter Module to get this requirement where I will have to access the HTTP header and then call the authentication service. The issue is that I am not able to find a function that will get me the HTTP header value. If you guys can help out that would be great.
Alternative would be a way to pass the header value as a part of the message payload, if this is possible then we can also do this using a Java mapping.
Any suggestions???
Thanks
Nikhil
Hi Nikhil,
Assuming you are working on PO(BPM) and have REST adapter for connection, you can orchestrate the solution to get the HTTP headers using Dynamic configuration. Check this blog for more details on reading HTTP headers in dynamic configuration:
https://blogs.sap.com/2014/12/18/pi-rest-adapter-using-dynamic-attributes/
Regards,
Sanjeev
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nikhil,
I guess you are receiving JSON payload and using REST sender adapter. Then you can always use the option
"Retrieve the value from a Custom HTTP Header by specifying the Header Field". This allows you to store the value in an custom attribute and again read the same using UDF. You can check this option in this link. Change this option(custom attribute) in image to Custom HTTP header.
Then use an UDF to read the "mode" variable as "attribute"
public String getASMA (String namespace,String attribute,Container container) throws StreamTransformationException{
Map<String, Object> all = container.getInputHeader().getAll();
DynamicConfiguration dynConf = (DynamicConfiguration)all.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create( namespace, attribute);
String value = dynConf.get(key);
return value;
}
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.